sio2_socket.cc File Reference

#include "sio2.h"

Include dependency graph for sio2_socket.cc:


Functions

SIO2socketsio2SocketInit (char *_name, unsigned int _buf_size)
SIO2socketsio2SocketFree (SIO2socket *_SIO2socket)
unsigned char sio2SocketListen (SIO2socket *_SIO2socket, unsigned short _port)
unsigned char sio2SocketConnect (SIO2socket *_SIO2socket, char *_host, unsigned short _port)
void sio2SocketDisconnect (SIO2socket *_SIO2socket)
unsigned char sio2SocketSend (SIO2socket *_SIO2socket, const char *_fmt,...)
int sio2SocketAccept (SIO2socket *_SIO2socket)
void sio2SocketSetOption (SIO2socket *_SIO2socket, unsigned int _mask)

Function Documentation

int sio2SocketAccept ( SIO2socket _SIO2socket  ) 

Tell the SIO2socket to accept an incoming connection.

_SIO2socket: A valid SIO2socket pointer, set in listen mode.

return the new socket ID taken by the current client.

References SIO2socket::sck, and SIO2socket::sck_addr.

unsigned char sio2SocketConnect ( SIO2socket _SIO2socket,
char _host,
unsigned short  _port 
)

Tell the SIO2socket to connect to a specific IP and port.

_SIO2socket: A valid SIO2socket pointer.
_host: A character string represensting an IP address. ex: "127.0.0.1"
_port: A valid socket port from 0 to 65535.

return 1 or 0 upon success or failure.

References SIO2socket::sck, SIO2socket::sck_addr, and sio2SocketDisconnect().

Referenced by sio2UrlDownload().

Here is the call graph for this function:

void sio2SocketDisconnect ( SIO2socket _SIO2socket  ) 

Disconnect a previously connected SIO2socket.

_SIO2socket: A valid SIO2socket pointer.

References SIO2socket::sck.

Referenced by sio2SocketConnect(), sio2SocketFree(), and sio2SocketListen().

SIO2socket* sio2SocketFree ( SIO2socket _SIO2socket  ) 

Free a previously initialized SIO2socket. The socket will also disconnect if connected, then freed.

return a NULL SIO2socket handle.

References SIO2socket::buf, and sio2SocketDisconnect().

Referenced by sio2UrlFree().

Here is the call graph for this function:

SIO2socket* sio2SocketInit ( char _name,
unsigned int  _buf_size 
)

Create a new SIO2socket. Please take note that the SIO2socket structure will not be added to the global SIO2resource pointer. SIO2sockets are like SIO2threads, they are independent of the resources and should be managed by users.

_name: The internal name to identify the socket.

return a new SIO2socket handle.

References SIO2socket::buf, SIO2socket::buf_size, SIO2socket::name, SIO2socket::sck, SIO2socket::sck_addr, and sio2StringCpy().

Referenced by sio2UrlInit().

Here is the call graph for this function:

unsigned char sio2SocketListen ( SIO2socket _SIO2socket,
unsigned short  _port 
)

Tell an SIO2socket to start listening on a specific port.

_port: A valid port from 0 to 65535.
_maxc: The maximum amount of clients that can use the SIO2socket.

return 1 or 0 upon success or failure.

References SIO2socket::sck, SIO2socket::sck_addr, and sio2SocketDisconnect().

Here is the call graph for this function:

unsigned char sio2SocketSend ( SIO2socket _SIO2socket,
const char _fmt,
  ... 
)

Tell the SIO2socket to send bytes over the connection.

_SIO2socket: A valid SIO2socket pointer.
_buf: An array of bytes representing the data to be sent.

return 1 or 0 upon success or failure.

References SIO2socket::buf, SIO2socket::buf_size, SIO2socket::sck, and sio2StringLen().

Referenced by sio2UrlDownload().

Here is the call graph for this function:

void sio2SocketSetOption ( SIO2socket _SIO2socket,
unsigned int  _mask 
)


Generated on Thu Mar 4 15:41:49 2010 for SIO2 Engine by  doxygen 1.5.6