TcpState TcpState TcpState TcpState Enum

Definición

Especifica los estados de una conexión TCP (Protocolo de control de transmisión).Specifies the states of a Transmission Control Protocol (TCP) connection.

public enum class TcpState
public enum TcpState
type TcpState = 
Public Enum TcpState
Herencia

Campos

Closed Closed Closed Closed 1

La conexión TCP está cerrada.The TCP connection is closed.

CloseWait CloseWait CloseWait CloseWait 8

El extremo local de la conexión TCP está esperando una solicitud de finalización de conexión del usuario local.The local endpoint of the TCP connection is waiting for a connection termination request from the local user.

Closing Closing Closing Closing 9

El extremo local de la conexión TCP está esperando una confirmación de la solicitud de finalización de conexión enviada previamente.The local endpoint of the TCP connection is waiting for an acknowledgement of the connection termination request sent previously.

DeleteTcb DeleteTcb DeleteTcb DeleteTcb 12

Se está eliminando el búfer del control de transmisión (TCB) para la conexión TCP.The transmission control buffer (TCB) for the TCP connection is being deleted.

Established Established Established Established 5

El protocolo de enlace TCP ha finalizado.The TCP handshake is complete. La conexión se ha establecido y se pueden enviar datos.The connection has been established and data can be sent.

FinWait1 FinWait1 FinWait1 FinWait1 6

El extremo local de la conexión TCP está esperando una solicitud de finalización de conexión del extremo remoto, o una confirmación de la solicitud de finalización de conexión enviada previamente.The local endpoint of the TCP connection is waiting for a connection termination request from the remote endpoint or for an acknowledgement of the connection termination request sent previously.

FinWait2 FinWait2 FinWait2 FinWait2 7

El extremo local de la conexión TCP está esperando una solicitud de finalización de conexión del extremo remoto.The local endpoint of the TCP connection is waiting for a connection termination request from the remote endpoint.

LastAck LastAck LastAck LastAck 10

El extremo local de la conexión TCP está esperando la confirmación final de la solicitud de finalización de conexión enviada previamente.The local endpoint of the TCP connection is waiting for the final acknowledgement of the connection termination request sent previously.

Listen Listen Listen Listen 2

El extremo local de la conexión TCP está realizando escuchas para una solicitud de conexión desde cualquier extremo remoto.The local endpoint of the TCP connection is listening for a connection request from any remote endpoint.

SynReceived SynReceived SynReceived SynReceived 4

El extremo local de la conexión TCP ha enviado y recibido una solicitud de conexión, y espera una confirmación.The local endpoint of the TCP connection has sent and received a connection request and is waiting for an acknowledgment.

SynSent SynSent SynSent SynSent 3

El extremo local de la conexión TCP ha enviado un encabezado de segmento al extremo remoto con el bit de control de sincronización (SYN) establecido y está esperando una solicitud de conexión correspondiente.The local endpoint of the TCP connection has sent the remote endpoint a segment header with the synchronize (SYN) control bit set and is waiting for a matching connection request.

TimeWait TimeWait TimeWait TimeWait 11

El extremo local de la conexión TCP está esperando el tiempo suficiente para asegurar que el extremo remoto ha recibido la confirmación de su solicitud de finalización de conexión.The local endpoint of the TCP connection is waiting for enough time to pass to ensure that the remote endpoint received the acknowledgement of its connection termination request.

Unknown Unknown Unknown Unknown 0

El estado de la conexión TCP es desconocido.The TCP connection state is unknown.

Ejemplos

En el ejemplo de código siguiente se cuenta las conexiones TCP establecidas.The following code example counts the established TCP connections.

void CountTcpConnections()
{
   IPGlobalProperties ^ properties = IPGlobalProperties::GetIPGlobalProperties();
   array<TcpConnectionInformation^>^connections = properties->GetActiveTcpConnections();
   int establishedConnections = 0;
   System::Collections::IEnumerator^ myEnum1 = connections->GetEnumerator();
   while ( myEnum1->MoveNext() )
   {
      TcpConnectionInformation ^ t = safe_cast<TcpConnectionInformation ^>(myEnum1->Current);
      if ( t->State == TcpState::Established )
      {
         establishedConnections++;
      }

      Console::Write( "Local endpoint: {0} ", t->LocalEndPoint->Address );
      Console::WriteLine( "Remote endpoint: {0} ", t->RemoteEndPoint->Address );
   }

   Console::WriteLine( "There are {0} established TCP connections.", establishedConnections );
}
public static void CountTcpConnections()
{
    IPGlobalProperties properties = IPGlobalProperties.GetIPGlobalProperties();
    TcpConnectionInformation[] connections = properties.GetActiveTcpConnections();
    int establishedConnections = 0;
    
    foreach (TcpConnectionInformation t in connections)
    {
        if (t.State == TcpState.Established)
        {
             establishedConnections++;
        }
        Console.Write("Local endpoint: {0} ",t.LocalEndPoint.Address);
        Console.WriteLine("Remote endpoint: {0} ",t.RemoteEndPoint.Address);
       
    }
     Console.WriteLine("There are {0} established TCP connections.",
        establishedConnections);
}
Public Shared Sub CountTcpConnections() 
    Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties()
    Dim connections As TcpConnectionInformation() = properties.GetActiveTcpConnections()
    Dim establishedConnections As Integer = 0
    
    Dim t As TcpConnectionInformation
    For Each t In  connections
        If t.State = TcpState.Established Then
            establishedConnections += 1
        End If
        Console.Write("Local endpoint: {0} ", t.LocalEndPoint.Address)
        Console.WriteLine("Remote endpoint: {0} ", t.RemoteEndPoint.Address)
    Next t 
    Console.WriteLine("There are {0} established TCP connections.", establishedConnections)

End Sub 'CountTcpConnections

Comentarios

Esta enumeración define los valores válidos para el State propiedad.This enumeration defines valid values for the State property. TCP es un protocolo de capa de transporte responsable de enviar y recibir paquetes de datos de forma confiable.TCP is a transport layer protocol responsible for reliably sending and receiving data packets. Los Estados TCP en esta enumeración se definen en IETF RFC 793 en https://www.ietf.org .The TCP states in this enumeration are defined in IETF RFC 793 available at https://www.ietf.org.

Se aplica a