/*********************************************/ /* Client functions head file using BSD */ /* for 7188E modules */ /* v1.00.0 [July,03,2002] by Sean */ /* v1.01.0[Jan,17,2003] Modified by Sean */ /*********************************************/ int BuildSocket(unsigned char *cIP,int iPort,long ltimeout); /************************************************************************* * Structure the connection of TCP/IP * cIP: IP address of the server, for example "192.168.10.3". * iPort: The port number of the server . * iTimeout: The timeout value for building a connection,in millisecond units. * * Return value * -1: build socket Error. * >=0: success, the return value ,Socket identifier, can be used by other functions. *************************************************************************/ int SendSocketBinaryCmd(int iSocket,char *cOutBuf,int iLen); /************************************************************************* * Send data * When the server is connected, sends the data to it. * iSocket: Socket identifier. * cOutBuf: Pointer to data to be sent. * iLen: Number of bytes to send. * * Return value * -1: Send data Error. * >=0: Number of bytes sent. *************************************************************************/ int ReceiveSocketBinaryCmd(int iSocket,char *cInBuf,int iMaxLen,int iTimeout); /************************************************************************* * Receive data * * When server is connected, receives the data from it. * iSocket: Socket identifier. * cInBuf: Input buffer that uesed to store received data. * iMaxLen: Maximum number of bytes to be received.if the total bytes in the Receive buffer are larger then Maximum bytes,the over bytes will be ignored after running ReceiveSocketBinaryCmd(). * iTimeout: The timeout value for receiving data ,in millisecond units. * * Return value * -1: Receive data Error. * >=0: Number of bytes received. * *************************************************************************/ void KillSocket(int iSocket); /************************************************************************* * killsockets * shutdown, closethe socket . * iSocket: Socket identifier. *************************************************************************/