:GetSocket()


Class

     aprSMTP()

 

Syntax

     :GetSocket( [hSession] ) --> nSocket

 

Parameters

     hSession (optional)

     If hSession is not passed, the value in :Session

 

Return

     nSocket

     If the function succeeds, a handle to the client socket is returned.

     If the function fails, the return value is INVALID_SOCKET (-1).

 

Description

The :GetSocket() Method returns a handle to the socket that is being used to send commands and receive result codes from the server. This socket may be used with any of the standard Windows Sockets API functions.

 

Note:
Caution should be exercised when using the Windows Sockets API directly against the socket returned by this Method. Reading or writing data directly to or from the socket, or changing it's state, can result in unpredictable behavior by the client.