![]() |
Receive() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: SpoofSocket.h |
virtual int Receive( char* buf, int bufLen);
Recieve data from remote socket
try { if (!ValidSocket()) return SOCKET_ERROR; //Receive data int iResult; //Receive if (m_Protocol!=IPPROTO_TCP) { sockaddr saConnected; int iTmp; iTmp=sizeof(saConnected); //Accept it iResult=recvfrom(GetHandle(),buf,bufLen,NULL,&saConnected,&iTmp); //If OK set it if (iResult!=SOCKET_ERROR) memcpy(&m_ConnectedTo,&saConnected,sizeof(saConnected)); } else iResult=recv(GetHandle(),buf,bufLen,NULL); //Check if error if (iResult==SOCKET_ERROR) //Error SetLastError("Receive"); //Number of bytes received return iResult; } ERROR_HANDLER_RETURN("Receive",SOCKET_ERROR)
![]() |
Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 24 Apr 2001. |