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

            return(new TcpTransportFactory(configuration));
        }
 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;
 }
 public static TcpTransportFactory CreateServer(int port) {
    var configuration = new TcpTransportConfiguration(
       new IPEndPoint(IPAddress.Any, port),
       TcpRole.Server);
    return new TcpTransportFactory(configuration);
 }
 public TcpTransportFactory(TcpTransportConfiguration configuration) {
    this.configuration = configuration;
 }