package srt

  1. Overview
  2. Docs

OCaml bindings for the libsrt.

type socket
type socket_status = [
  1. | `Init
  2. | `Opened
  3. | `Listening
  4. | `Connecting
  5. | `Connected
  6. | `Broken
  7. | `Closing
  8. | `Closed
  9. | `Nonexist
]
type transtype = [
  1. | `Live
  2. | `File
  3. | `Invalid
]
type 'a socket_opt
val messageapi : bool socket_opt
val payloadsize : int socket_opt
val transtype : transtype socket_opt
val rcvsyn : bool socket_opt
val sndsyn : bool socket_opt
val reuseaddr : bool socket_opt
val rcvbuf : int socket_opt
val sndbuf : int socket_opt
val udp_rcvbuf : int socket_opt
val udp_sndbuf : int socket_opt
val enforced_encryption : bool socket_opt
type errno = [
  1. | `Easyncfail
  2. | `Easyncrcv
  3. | `Easyncsnd
  4. | `Eboundsock
  5. | `Econgest
  6. | `Econnfail
  7. | `Econnlost
  8. | `Econnrej
  9. | `Econnsetup
  10. | `Econnsock
  11. | `Eduplisten
  12. | `Efile
  13. | `Einvalbufferapi
  14. | `Einvalmsgapi
  15. | `Einvop
  16. | `Einvparam
  17. | `Einvpollid
  18. | `Einvrdoff
  19. | `Einvsock
  20. | `Einvwroff
  21. | `Elargemsg
  22. | `Enobuf
  23. | `Enoconn
  24. | `Enolisten
  25. | `Enoserver
  26. | `Epeererr
  27. | `Epollempty
  28. | `Erdperm
  29. | `Erdvnoserv
  30. | `Erdvunbound
  31. | `Eresource
  32. | `Esclosed
  33. | `Esecfail
  34. | `Esockfail
  35. | `Esysobj
  36. | `Ethread
  37. | `Etimeout
  38. | `Eunboundsock
  39. | `Eunknown
  40. | `Ewrperm
  41. | `Success
]
exception Error of errno * string
val startup : unit -> unit
val cleanup : unit -> unit
val create_socket : unit -> socket
val getsockstate : socket -> socket_status
val bind : socket -> Unix.sockaddr -> unit
val listen : socket -> int -> unit
val accept : socket -> socket * Unix.sockaddr
val connect : socket -> Unix.sockaddr -> unit
val rendez_vous : socket -> Unix.sockaddr -> Unix.sockaddr -> unit
val send : socket -> bytes -> int
val recv : socket -> bytes -> int -> int
val sendmsg : socket -> bytes -> int -> bool -> int
val recvmsg : socket -> bytes -> int -> int
val getsockflag : socket -> 'a socket_opt -> 'a
val setsockflag : socket -> 'a socket_opt -> 'a -> unit
val close : socket -> unit
module Log : sig ... end
module Poll : sig ... end
module Stats : sig ... end
OCaml

Innovation. Community. Security.