예제 #1
0
        public void reply_uri_when_not_durable()
        {
            var endpoint = new TcpEndpoint(4444);

            endpoint.Mode = EndpointMode.BufferedInMemory;

            endpoint.ReplyUri().ShouldBe($"tcp://localhost:4444".ToUri());
        }
예제 #2
0
        public void reply_uri_when_not_durable()
        {
            var endpoint = new TcpEndpoint(4444);

            endpoint.IsDurable = false;

            endpoint.ReplyUri().ShouldBe($"tcp://localhost:4444".ToUri());
        }
예제 #3
0
        public void reply_uri_when_durable()
        {
            var endpoint = new TcpEndpoint(4444);

            endpoint.Mode = EndpointMode.Durable;

            endpoint.ReplyUri().ShouldBe($"tcp://localhost:4444/durable".ToUri());
        }
예제 #4
0
        public void parsing_uri(string uri, string host, int port, EndpointMode mode)
        {
            var endpoint = new TcpEndpoint();

            endpoint.Parse(uri.ToUri());

            endpoint.HostName.ShouldBe(host);
            endpoint.Port.ShouldBe(port);
            endpoint.Mode.ShouldBe(mode);
        }
예제 #5
0
        public void parsing_uri(string uri, string host, int port, bool isDurable)
        {
            var endpoint = new TcpEndpoint();

            endpoint.Parse(uri.ToUri());

            endpoint.HostName.ShouldBe(host);
            endpoint.Port.ShouldBe(port);
            endpoint.IsDurable.ShouldBe(isDurable);
        }
예제 #6
0
        public FastServer()
        {
            var endpoint = new TcpEndpoint(16121);

            _FastServer = new Sessions.FastServer("test", _scpSessionProtocol, endpoint)
            {
                SessionHandler = new SessionHandler()
            };

            Global.ErrorHandler = new ServerErrorHandler();

            _FastServer.Listen();
        }
예제 #7
0
        public FastServer()
        {
            var endpoint = new TcpEndpoint(16121);

            _sessionHandler = new SessionHandler();

            var fs = new Sessions.FastServer("test", _scpSessionProtocol, endpoint);

            Global.ErrorHandler = new ServerErrorHandler();
            fs.SessionHandler   = _sessionHandler;

            fs.Listen();
        }
예제 #8
0
 public TcpServiceConnection(TcpClient tcpClient, TcpEndpoint tcpEndPoint, string hostListenerName, bool closeAfterSend, Listener listener, Encoding encoding)
     : base(tcpClient, tcpEndPoint, hostListenerName, closeAfterSend)
 {
     this.listener = listener;
     this.encoding = encoding;
 }
예제 #9
0
 public override TcpBaseServiceConnection CreateClientConnectionHandler(TcpClient tcpClient, TcpEndpoint tcpEndPoint, string hostListenerName, bool closeAfterSend)
 {
     return(new TcpServiceConnection(tcpClient, tcpEndPoint, hostListenerName, closeAfterSend, listener, encoding));
 }
예제 #10
0
        /// <summary>
        ///     Directs the application to listen at the designated port in a
        ///     fast, but non-durable way
        /// </summary>
        /// <param name="port"></param>
        public IListenerConfiguration ListenAtPort(int port)
        {
            var settings = Get <TcpTransport>().ListenTo(TcpEndpoint.ToUri(port));

            return(new ListenerConfiguration(settings));
        }
예제 #11
0
        /// <summary>
        ///     Publish messages using the TCP transport to the specified
        ///     server name and port
        /// </summary>
        /// <param name="hostName"></param>
        /// <param name="port"></param>
        public ISubscriberConfiguration ToServerAndPort(string hostName, int port)
        {
            var uri = TcpEndpoint.ToUri(port, hostName);

            return(To(uri));
        }
예제 #12
0
        /// <summary>
        ///     Publish the designated message types using Jasper's lightweight
        ///     TCP transport locally to the designated port number
        /// </summary>
        /// <param name="port"></param>
        public ISubscriberConfiguration ToPort(int port)
        {
            var uri = TcpEndpoint.ToUri(port);

            return(To(uri));
        }