TCPIsConnected Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
TCPIsConnected Function
C
BOOL TCPIsConnected(
    TCP_SOCKET hTCP
);
Description

This function determines if a socket has an established connection to a remote node. Call this function after calling TCPOpen to determine when the connection is set up and ready for use. This function was historically used to check for disconnections, but TCPWasReset is now a more appropriate solution.

Preconditions

TCP is initialized.

Parameters
Parameters 
Description 
hTCP 
The socket to check. 
Return Values
Return Values 
Description 
TRUE 
The socket has an established connection to a remote node. 
FALSE 
The socket is not currently connected. 
Remarks

A socket is said to be connected only if it is in the TCP_ESTABLISHED state. Sockets in the process of opening or closing will return FALSE.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.