Class CSpoofSocket::
Receive()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: pResolveDNSNext page: ResolveDNS    Show member index
Public Function Declared in:
SpoofSocket.h

'Declaration' icon -- Shortcut to top of page. Declaration

virtual int Receive(
    char* buf,
    int bufLen);

'Description' icon -- Shortcut to top of page. Description

Recieve data from remote socket

'Function Body' icon -- Shortcut to top of page. Function Body

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)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CSpoofBase  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 27 Jun 2001.