For more information about the source code, see rlib open-source projects.
The following is the header file of rlib1.x:
Namespace system {namespace net {// <summary> // provides standard access to Winsock /// </Summary> class export sockets {protected: Socket m_socket; sockaddr_in m_addr; exception * m_error; public: Sockets (socket S = invalid_socket );~ Sockets (); rlib_classnewdel; public: /// <summary> /// method allows you to obtain the socket for more operations // You can inherit and expand the functions of the sockets class /// </Summary> Operator socket (); /// <summary> /// set the sending timeout /// </Summary> bool setsndtimeo (INT timeout ); /// <summary> /// obtain the sending buffer /// </Summary> int getsndbuf (); /// <summary> /// set the receiving timeout /// </Summary> bool setrcvtimeo (INT timeout ); /// <summary> /// obtain the receiving buffer /// </Summary> int getrcvbuf (); /// <summary> /// closes an existing socket /// </Summary> bool close (); /// <summary> /// establishes a connection to a specified socket // </Summary> bool connect (char * Host, unsigned int host_len, u_short port ); /// <summary> /// sends data on a connected socket // when an error occurs, size is used to receive the sent length // </Summary> bool send (char * data, int * size ); /// <summary> // specify es data from a connected or bound socket // when an error occurs, size is used to receive received length // </Summary> int recvex (char * Buf, int * size ); /// <summary> /// es data from a connected or bound socket // This method does not guarantee that the specified size is received. /// </Summary> int Recv (char * Buf, int size); // <summary> // associates a local address with a socket // </Summary> int BIND (ulong ADDR, u_short port ); /// <summary> /// associates a local address with a socket // The method is bound to all addresses /// </Summary> int BIND (u_short port ); /// <summary> // places a socket a state where it is listening for an incoming connection // </Summary> int listen (INT backlog = somaxconn ); /// <summary> /// permits an incoming connection attempt on a socket // an optional pointer to a buffer that matches es the address of the connecting entity, /// as known to the communications layer. /// </Summary> sockets * accept (sockaddr_in * ADDR = NULL, int * addrlen = NULL ); /// <summary> /// disables sends or distinct es on a socket // </Summary> int Shutdown (INT how = sd_both ); /// <summary> /// obtain the wincock exception information // This method is only provided to the Instance Object /// </Summary> exception * getlastexception (); /// <summary> /// obtain a value indicating whether a connection has been established with the Internet. /// </Summary> bool isconnect; public: /// <summary> /// obtain the name of the Local Computer /// </Summary> static bool getlocalhost (char * Host, int hostlen ); /// <summary> /// obtain the address of the Local Computer /// </Summary> static bool getlocalipaddress (char * Host, paddrinfoa * addrinfo ); /// <summary> /// release addrinfo obtained by getlocalipaddress /// </Summary> static void freelocalipaddress (paddrinfoa * addrinfo ); /// <summary> /// converts a string containing an (IPv4) internet Protocol dotted address into a proper address for the in_addr structure // </Summary> static unsigned long limit 4stringtoaddress (const char * CP ); /// <summary> /// converts an (IPv4) internet network address into a string in Internet standard dotted format // </Summary> static char * ipv4addresstostring (in_addr in ); /// <summary> /// get the error description of wincock /// </Summary> static bool getlasterror (lpvoid buffer, size_t size, int err = 0 ); /// <summary >/// when you no longer use Winsock, calling this method will release the network module memory /// </Summary> static void dispose ();};}}