tfResetConnection

Jump to: navigation, search

Table of Contents >> Programmer's Reference


#include <trsocket.h>


int tfResetConnection (int socketDescriptor);


Function Description

This function is used to abort a connection on a socket. It only works with TCP (STREAM) sockets and sends a RST and discards all outstanding data.


Parameters

  • socketDescriptor
    The socket descriptor to reset.


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
    'socketDescriptor' is not a valid descriptor.
  • TM_EOPNOTSUPP
    The socket is not a STREAM socket.


Table of Contents >> Programmer's Reference