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, 'b) socket_opt
type listen_callback = socket -> int -> Unix.sockaddr -> string option -> bool
val messageapi : ([ `Write ], bool) socket_opt
val payloadsize : ([ `Write ], int) socket_opt
val transtype : ([ `Write ], transtype) socket_opt
val rcvsyn : ([ `Read | `Write ], bool) socket_opt
val sndsyn : ([ `Read | `Write ], bool) socket_opt
val conntimeo : ([ `Write ], int) socket_opt
val rcvtimeo : ([ `Read | `Write ], int) socket_opt
val sndtimeo : ([ `Read | `Write ], int) socket_opt
val reuseaddr : ([ `Read | `Write ], bool) socket_opt
val rcvbuf : ([ `Read | `Write ], int) socket_opt
val sndbuf : ([ `Read | `Write ], int) socket_opt
val udp_rcvbuf : ([ `Read | `Write ], int) socket_opt
val udp_sndbuf : ([ `Read | `Write ], int) socket_opt
val rcvdata : ([ `Read ], int) socket_opt
val rcvlatency : ([ `Read | `Write ], int) socket_opt
val enforced_encryption : ([ `Write ], bool) socket_opt
val streamid : ([ `Read | `Write ], string) socket_opt
val passphrase : ([ `Write ], string) socket_opt
val pbkeylen : ([ `Read | `Write ], int) 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_callback : socket -> listen_callback -> 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 -> ([> `Read ], 'a) socket_opt -> 'a
val setsockflag : socket -> ([> `Write ], '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.