Documentation

Socket.Socket

@[extern lean_socket_mk]

Create a new Socket using the specified domain and type.

@[extern lean_socket_close]

Close the Socket.

NOTE: Although Socket is designed to be automatically closed when garbage collected, it's a good practice to manually close it beforehand.

@[extern lean_socket_connect]

Initiate a connection on a socket.

@[extern lean_socket_bind]

Bind a name to a socket.

@[extern lean_socket_listen]

Listen for connections on a socket.

@[extern lean_socket_accept]

Accept a connection on a socket.

@[extern lean_socket_send]

Send a message from a socket.

@[extern lean_socket_recv]

Receive a message from a socket.

@[extern lean_socket_sendto]

Send a message from a socket.

@[extern lean_socket_recvfrom]

Receive a message from a socket.

@[extern lean_socket_shutdown]

Shut down part of a full-duplex connection.

@[extern lean_socket_peer]

Get address of connected peer.