sig
type t
exception Socket_Not_Ready
exception Socket_Disconnected
exception Socket_Partial
exception Socket_Error
val init : unit -> unit
external create : unit -> SFTcpSocket.t = "caml_sfTcpSocket_create"
external destroy : socket:SFTcpSocket.t -> unit
= "caml_sfTcpSocket_destroy"
external connect :
socket:SFTcpSocket.t ->
port:int -> address:SFIpAddress.t -> ?timeout:SFTime.t -> unit -> unit
= "caml_sfTcpSocket_connect"
external disconnect : socket:SFTcpSocket.t -> unit
= "caml_sfTcpSocket_disconnect"
external setBlocking : socket:SFTcpSocket.t -> blocking:bool -> unit
= "caml_sfTcpSocket_setBlocking"
external isBlocking : socket:SFTcpSocket.t -> bool
= "caml_sfTcpSocket_isBlocking"
external send : socket:SFTcpSocket.t -> data:string -> unit
= "caml_sfTcpSocket_send"
external send_sub :
socket:SFTcpSocket.t -> data:string -> ofs:int -> len:int -> unit
= "caml_sfTcpSocket_send_sub"
external receive : socket:SFTcpSocket.t -> data:bytes -> int
= "caml_sfTcpSocket_receive"
val receive_str : socket:SFTcpSocket.t -> string
external sendPacket : socket:SFTcpSocket.t -> packet:SFPacket.t -> unit
= "caml_sfTcpSocket_sendPacket"
external receivePacket : socket:SFTcpSocket.t -> packet:SFPacket.t -> unit
= "caml_sfTcpSocket_receivePacket"
external getLocalPort : socket:SFTcpSocket.t -> int
= "caml_sfTcpSocket_getLocalPort"
external getRemotePort : socket:SFTcpSocket.t -> int
= "caml_sfTcpSocket_getRemotePort"
external getRemoteAddress : socket:SFTcpSocket.t -> SFIpAddress.t
= "caml_sfTcpSocket_getRemoteAddress"
val link_me : unit
end