1,866 bytes added
, 14:55, 5 April 2015
nsysnet.rpl is the library that provides socket related functions.
==Functions==
===Base===
{| class="wikitable"
!Name
!Prototype
!Description
!Returns
|-
|SOInit
|<code>int SOInit(void);</code>
|Initializes the library.
|SO_*
|-
|SOFinish
|<code>int SOFinish(void);</code>
|Cleans up after the library.
|SO_*
|}
===Networking===
{| class="wikitable"
!Name
!Prototype
!Description
!Returns
|-
|SOConnect
|<code>int SOConnect(int fd, struct sockaddr *addr, int addrlen);</code>
|Connects to the defined target
|SO_*
|-
|SOListen
|<code>int SOListen(int fd, int backlog);</code>
|Listens for connections
|SO_*
|-
|SORecv
|<code>int SORecv(int fd, void *buffer, int len, int flags);</code>
|Listens for connections
|SO_*
|-
|SORecvFrom
|<code>int SORecvFrom(int fd, void *buffer, int len, int flags, struct sockaddr *from, int *fromlen);</code>
|Listens for connections
|SO_*
|-
|SOSend
|<code>int SOSend(int fd, const void *buffer, int len, int flags);</code>
|Listens for connections
|SO_*
|-
|SOSendTo
|<code>int SOSendTo(int fd, const void *buffer, int len, int flags, const struct sockaddr *dest_addr, int dest_len);</code>
|Listens for connections
|SO_*
|}
===Error===
{| class="wikitable"
!Name
!Prototype
!Description
!Returns
|-
|SOInit
|<code>int SOLastError(void);</code>
|Recives the latest error???
|The latest error(SO_*)???
|}
==Error Codes==
The error codes that SO functions can return.
if the error code starts with "SO_E" so were the operation not successful otherwise it were.
{| class="wikitable"
!Name
!Value
!Description
|-
|SO_SUCCESS
|0
|The operation were successful
|-
|SO_ETIMEDOUT
|2
|The connection timed out
|-
|SO_ECONNREFUSED
|7
|The connection were refused
|-
|SO_ERROR
|41
|The operation hit a generic error and were not successful
|-
|SO_ELIBNOTREADY
|43
|The library is not ready, did you forget to initialize it?
|}