tfSslConnectUserClose

Jump to: navigation, search

Table of Contents >> SSL Programmer's Reference


#include <trsocket.h>


int tfSslConnectUserClose (int socketDescriptor);


Function Description

User makes this function call to close a SSL connection. Inside this function, we will flush the SSL send buffer and send a close notify to the SSL peer. User may call tfClose() to close the whole socket instead of just closing the SSL layer. (Note that the peer may not accept any data after SSL layer is closed.)


Parameters

  • socketDescriptor
    Socket descriptor


Returns

  • TM_ENOERROR
    Success.
  • TM_SOCKET_ERROR
    Failure.


Note Note: TM_SOCKET_ERROR means that this socket call has failed and the errorCode has been set on the socket itself.

To retrieve the socket error the user must call tfGetSocketError(socketDescriptor).


Possible socket errors

  • TM_EBADF
    No data was flushed. The socket descriptor was invalid.
  • TM_EPROTONOSUPPORT
    No data was flushed. The socket descriptor was not a TCP socket.
  • TM_EINVAL
    No data was flushed. The TCP connection is not established.
  • TM_ESHUTDOWN
    No data was flushed. The TCP connection is has been shutdown.


Table of Contents >> SSL Programmer's Reference