CSocket::FromHandle

Returns a pointer to a CSocket object.

static CSocket* PASCAL FromHandle(
   SOCKET hSocket 
);

Parameters

  • hSocket
    Contains a handle to a socket.

Return Value

A pointer to a CSocket object, or NULL if there is no CSocket object attached to hSocket.

Remarks

When given a SOCKET handle, if a CSocket object is not attached to the handle, the member function returns NULL and does not create a temporary object.

For more information, see Windows Sockets: Using Sockets with Archives.

Requirements

Header: afxsock.h

See Also

Reference

CSocket Class

Hierarchy Chart

CAsyncSocket::FromHandle

Other Resources

CSocket Members