sig
type t
exception Socket_Not_Ready
exception Socket_Disconnected
exception Socket_Partial
exception Socket_Error
val init : unit -> unit
external create : unit -> SFUdpSocket.t = "caml_sfUdpSocket_create"
external destroy : socket:SFUdpSocket.t -> unit
= "caml_sfUdpSocket_destroy"
external setBlocking : socket:SFUdpSocket.t -> blocking:bool -> unit
= "caml_sfUdpSocket_setBlocking"
external bind :
socket:SFUdpSocket.t -> ?address:SFIpAddress.t -> port:int -> unit
= "caml_sfUdpSocket_bind"
external unbind : socket:SFUdpSocket.t -> unit = "caml_sfUdpSocket_unbind"
external send :
socket:SFUdpSocket.t ->
data:string -> address:SFIpAddress.t -> port:int -> unit
= "caml_sfUdpSocket_send"
external receive :
socket:SFUdpSocket.t -> data:bytes -> int * SFIpAddress.t * int
= "caml_sfUdpSocket_receive"
external sendPacket :
socket:SFUdpSocket.t ->
packet:SFPacket.t -> address:SFIpAddress.t -> port:int -> unit
= "caml_sfUdpSocket_sendPacket"
external receivePacket :
socket:SFUdpSocket.t -> packet:SFPacket.t -> SFIpAddress.t * int
= "caml_sfUdpSocket_receivePacket"
external isBlocking : socket:SFUdpSocket.t -> bool
= "caml_sfUdpSocket_isBlocking"
external getLocalPort : socket:SFUdpSocket.t -> int
= "caml_sfUdpSocket_getLocalPort"
external maxDatagramSize : unit -> int = "caml_sfUdpSocket_maxDatagramSize"
val link_me : unit
end