#include
<fbio.h>
Definition at line 206 of file fbio.h.
Public Member Functions |
|
FBTCPIP () | |
Constructor. |
|
bool | Read (int pSocket, void *lpBuffer, int nNumberOfBytesToRead, int *lpNumberOfBytesRead=NULL) |
Read data from a network socket
(non-blocking). |
|
bool | ReadBlocking (int pSocket, void *lpBuffer, int nNumberOfBytesToRead, int *lpNumberOfBytesRead=NULL, unsigned long pTimeOut=500) |
Read data from a network socket (blocking).
|
|
bool | ReadDatagram (int pSocket, void *lpBuffer, int nNumberOfBytesToRead, int *lpNumberOfBytesRead=NULL, unsigned long *pAddr=NULL, unsigned short *pPort=NULL) |
Read datagram from a network socket.
|
|
bool | Write (int pSocket, void *lpBuffer, int nNumberOfBytesToWrite, int *lpNumberOfBytesWritten=NULL) |
Write data to a network socket
(non-blocking). |
|
bool | WriteBlocking (int pSocket, void *lpBuffer, int nNumberOfBytesToWrite, int *lpNumberOfBytesToWrite=NULL, unsigned long pTimeOut=500) |
Write data to a network socket (blocking).
|
|
bool | WriteDatagram (int pSocket, void *lpBuffer, int nNumberOfBytesToWrite, int *lpNumberOfBytesToWrite, unsigned long pAddr, unsigned short pPort) |
Write a datagram to a network socket.
|
|
bool | CreateSocket (int &pSocket, FBTCPIPSocketType pType, char *pProtocol="ip", bool pNonBlocking=true) |
Create a network socket. |
|
bool | Bind (int &pSocket, unsigned long pAddr, int pPort=0) |
Bind a socket to an address. |
|
bool | Connect (int &pSocket, char *pAddr, int pPort) |
Connect to address pAddr, port
pPort with socket pSocket. |
|
bool | CloseSocket (int &pSocket) |
Close a network socket. |
|
int | Listen (int pSocket, int pBackLog=1) |
Place socket in mode to receive data.
|
|
int | Accept (int pSocket, unsigned long *pOutAddr=NULL) |
Accepts incoming port access. |
|
int | Select (int pSocket, bool pTestRead, bool pTestWrite, bool pTestError, unsigned long pTimeOutMilisecond=0) |
Test socket status. |
FBTCPIP | ( | ) |
Constructor.
bool Read | ( | int | pSocket, | |
void * | lpBuffer, | |||
int | nNumberOfBytesToRead, | |||
int * | lpNumberOfBytesRead =
NULL |
|||
) |
Read data from a network socket (non-blocking).
pSocket | Network socket. |
lpBuffer | Buffer to fill. |
nNumberOfBytesToRead | Number of bytes to read. |
lpNumberOfBytesRead | Number of bytes actually read (if not at NULL). |
bool ReadBlocking | ( | int | pSocket, | |
void * | lpBuffer, | |||
int | nNumberOfBytesToRead, | |||
int * | lpNumberOfBytesRead =
NULL , |
|||
unsigned long | pTimeOut = 500 |
|||
) |
Read data from a network socket (blocking).
pSocket | Network socket. |
lpBuffer | Buffer to fill. |
nNumberOfBytesToRead | Number of bytes to read. |
lpNumberOfBytesRead | Number of bytes actually read (if not at NULL). |
pTimeOut | Timeout for operation (default to DEFAULT_BLOCKING). |
bool ReadDatagram | ( | int | pSocket, | |
void * | lpBuffer, | |||
int | nNumberOfBytesToRead, | |||
int * | lpNumberOfBytesRead =
NULL , |
|||
unsigned long * | pAddr = NULL , |
|||
unsigned short * | pPort = NULL |
|||
) |
Read datagram from a network socket.
pSocket | Network socket. |
lpBuffer | Buffer to fill. |
nNumberOfBytesToRead | Number of bytes to read. |
lpNumberOfBytesRead | Number of bytes actually read (if not at NULL). |
pAddr | Address to get datagram. | |
pPort | Port to access at pAddr. |
bool Write | ( | int | pSocket, | |
void * | lpBuffer, | |||
int | nNumberOfBytesToWrite, | |||
int * | lpNumberOfBytesWritten =
NULL |
|||
) |
Write data to a network socket (non-blocking).
pSocket | Network socket. | |
lpBuffer | Buffer to write. | |
nNumberOfBytesToWrite | Number of bytes to write. |
lpNumberOfBytesWritten | Number of bytes actually written (if not at NULL). |
bool WriteBlocking | ( | int | pSocket, | |
void * | lpBuffer, | |||
int | nNumberOfBytesToWrite, | |||
int * | lpNumberOfBytesToWrite =
NULL , |
|||
unsigned long | pTimeOut = 500 |
|||
) |
Write data to a network socket (blocking).
pSocket | Network socket. | |
lpBuffer | Buffer to write. | |
nNumberOfBytesToWrite | Number of bytes to write. |
lpNumberOfBytesToWrite | Number of bytes actually written (if not at NULL). |
pTimeOut | Timeout for operation. |
bool WriteDatagram | ( | int | pSocket, | |
void * | lpBuffer, | |||
int | nNumberOfBytesToWrite, | |||
int * | lpNumberOfBytesToWrite, | |||
unsigned long | pAddr, | |||
unsigned short | pPort | |||
) |
Write a datagram to a network socket.
pSocket | Network socket. | |
lpBuffer | Buffer to write. | |
nNumberOfBytesToWrite | Number of bytes to write. |
lpNumberOfBytesToWrite | Number of bytes actually written (if not at NULL). |
pAddr | Address to write datagram. | |
pPort | Port to access at pAddr. |
bool CreateSocket | ( | int & | pSocket, | |
FBTCPIPSocketType | pType, | |||
char * | pProtocol = "ip" , |
|||
bool | pNonBlocking =
true |
|||
) |
Create a network socket.
pSocket | Network socket created. |
pType | Type of network socket. | |
pProtocol | Protocol to use to communicate. | |
pNonBlocking | Is socket blocking or non-blocking? |
bool Bind | ( | int & | pSocket, | |
unsigned long | pAddr, | |||
int | pPort = 0 |
|||
) |
Bind a socket to an address.
pSocket | Network socket. | |
pAddr | Address to bind socket to. | |
pPort | Port of pAddr to bind. |
bool Connect | ( | int & | pSocket, | |
char * | pAddr, | |||
int | pPort | |||
) |
Connect to address pAddr, port pPort with socket pSocket.
pSocket | Network socket. | |
pAddr | Address to connect to. | |
pPort | Port at pAddr to use. |
bool CloseSocket | ( | int & | pSocket | ) |
Close a network socket.
pSocket | Network socket. |
int Listen | ( | int | pSocket, | |
int | pBackLog = 1 |
|||
) |
Place socket in mode to receive data.
pSocket | Network socket. | |
pBackLog | Maximum length of the queue of pending connections (default is 1). |
int Accept | ( | int | pSocket, | |
unsigned long * | pOutAddr = NULL |
|||
) |
Accepts incoming port access.
pSocket | Network socket. |
pOutAddr | Buffer receiving address of sender. |
int Select | ( | int | pSocket, | |
bool | pTestRead, | |||
bool | pTestWrite, | |||
bool | pTestError, | |||
unsigned long | pTimeOutMilisecond =
0 |
|||
) |
Test socket status.
pSocket | Network socket to test. | |
pTestRead | Test for read? | |
pTestWrite | Test for write? | |
pTestError | Test for error? | |
pTimeOutMilisecond | Timeout for operation. |