예제 #1
0
 /// <summary>
 /// Creates a new Socket State from a socket and callback.
 /// </summary>
 /// <param name="socket">The socket related to this state.</param>
 /// <param name="established">Callback for an established connection.</param>
 /// <param name="failed">Callback for a failed connection.</param>
 internal SocketState(
     Socket socket,
     AbstractNetworking.ConnectionEstablished established,
     AbstractNetworking.ConnectionFailed failed)
 {
     Socket = socket;
     ConnectionEstablished = established;
     ConnectionFailed      = failed;
 }
예제 #2
0
 /// <summary>
 /// Creates a client connection state with the given TCP Listener and callbacks.
 /// </summary>
 /// <param name="tcpListener">The TCP Listener that is being used to connect to the client.</param>
 /// <param name="established">The connection established callback.</param>
 /// <param name="failed">The connection failed callback.</param>
 internal TcpState(
     TcpListener tcpListener,
     AbstractNetworking.ConnectionEstablished established,
     AbstractNetworking.ConnectionFailed failed)
 {
     TcpListener           = tcpListener;
     ConnectionEstablished = established;
     ConnectionFailed      = failed;
 }