| CSpoofSocket:: Close() |

Public Function | Declared in: SpoofSocket.h

## Declaration

    virtual BOOL Close();

## Description

Close the socket

## Function Body

    try
    {
        //Close the socket
        //Quit if not ok
        if (!ValidSocket())
            return FALSE;

        //Close it
    #ifdef WIN32
        if (closesocket(GetHandle())==SOCKET_ERROR)
        {
            //Error in closing ?
            SetLastError("Close");
            return FALSE;
        }
    #else
        if (!close(GetHandle()))
        {
            //Error in closing ?
            SetLastError("Close");
            return FALSE;
        }
    #endif

        //Set the socket to invalid
        m_SpoofSocket=INVALID_SOCKET;

        return TRUE;
    }
    ERROR_HANDLER_RETURN("Close",FALSE)

## See Also

Class Overview | CSpoofBase | Hierarchy Chart

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.