示例#1
0
        public TcpCQRSServerBase(string serverUrl)
        {
            this.serviceUrl = serverUrl;

            var endpoints = IPResolver.GetIPEndPoints(serverUrl, 80);

            this.listeners = new SocketListener[endpoints.Count];
            for (var i = 0; i < endpoints.Count; i++)
            {
                var socket = new Socket(endpoints[i].AddressFamily, SocketType.Stream, ProtocolType.Tcp);
                socket.NoDelay = true;
                socket.Bind(endpoints[i]);
                var listener = new SocketListener(socket, Handle);
                this.listeners[i] = listener;
            }

            this.interfaceTypes = new ConcurrentList <Type>();
            this.commandTypes   = new ConcurrentList <Type>();
        }
示例#2
0
 public TcpCQRSClientBase(string serviceUrl)
 {
     this.serviceUrl = serviceUrl;
     this.endpoint   = IPResolver.GetIPEndPoints(serviceUrl, 80).First();
 }