コード例 #1
0
        public static TcpTransportFactory CreateServer(int port)
        {
            var configuration = new TcpTransportConfiguration(
                new IPEndPoint(IPAddress.Any, port),
                TcpRole.Server);

            return(new TcpTransportFactory(configuration));
        }
コード例 #2
0
 public static TcpTransportFactory CreateClient(IPAddress address, int port, TcpTransportHandshakeCompletionHandler handshakeCompletionHandler = null) {
    var configuration = new TcpTransportConfiguration(
       new IPEndPoint(address, port),
       TcpRole.Client);
    if (handshakeCompletionHandler != null) {
       configuration.HandshakeCompleted += handshakeCompletionHandler;
    }
    return new TcpTransportFactory(configuration);
 }
コード例 #3
0
        public static TcpTransportFactory CreateClient(IPAddress address, int port, TcpTransportHandshakeCompletionHandler handshakeCompletionHandler = null)
        {
            var configuration = new TcpTransportConfiguration(
                new IPEndPoint(address, port),
                TcpRole.Client);

            if (handshakeCompletionHandler != null)
            {
                configuration.HandshakeCompleted += handshakeCompletionHandler;
            }
            return(new TcpTransportFactory(configuration));
        }
コード例 #4
0
 public TcpTransportFactory(TcpTransportConfiguration configuration)
 {
     this.configuration = configuration;
 }
コード例 #5
0
 public static TcpTransportFactory CreateServer(int port) {
    var configuration = new TcpTransportConfiguration(
       new IPEndPoint(IPAddress.Any, port),
       TcpRole.Server);
    return new TcpTransportFactory(configuration);
 }
コード例 #6
0
 public TcpTransportFactory(TcpTransportConfiguration configuration) {
    this.configuration = configuration;
 }