TcpState

TcpState Represents the different states of a TCP connection.

This enum defines the possible states a TCP connection can be in during its lifecycle, from establishing a connection to closing or being in a waiting state.

Author

N7ghtm4r3

See also

RFC 793 for more information on TCP states.

Constructors

Link copied to clipboard
private constructor()

Entries

Link copied to clipboard

UNKNOWN Represents an unknown state of the TCP connection.

Link copied to clipboard

CLOSED Represents a closed TCP connection, either because it was closed normally or due to an error.

Link copied to clipboard

LISTEN Represents a TCP socket that is listening for incoming connection requests.

Link copied to clipboard

SYN_SENT Represents the state where a TCP client has sent a SYN message to initiate a connection.

Link copied to clipboard

SYN_RECV Represents the state where a TCP server has received a SYN message and is waiting to establish a connection.

Link copied to clipboard

ESTABLISHED Represents the state where the TCP connection has been successfully established and data can be transmitted.

Link copied to clipboard

FIN_WAIT_1 Represents the state where the connection is being closed, and a FIN message has been sent to the other side.

Link copied to clipboard

FIN_WAIT_2 Represents the state where the connection is being closed, and the peer has acknowledged the FIN message.

Link copied to clipboard

CLOSE_WAIT Represents the state where the local TCP stack has received a FIN from the peer and is waiting to close the connection.

Link copied to clipboard

CLOSING Represents the state where both sides are trying to close the connection simultaneously.

Link copied to clipboard

LAST_ACK Represents the state where the local TCP stack has sent a FIN and is waiting for the final acknowledgment from the peer.

Link copied to clipboard

TIME_WAIT Represents the state where the connection is waiting for a timeout to ensure the remote side has received the final acknowledgment.

Link copied to clipboard

NONE Represents the absence of a valid TCP state, typically used as a placeholder.

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun valueOf(value: String): TcpState

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.