コード例 #1
0
        public void GetChatServerEndpoint(string login)
        {
            // .Arrange
            var balancer = new Balancer("balancer-cloud.global.livetex");
            // .Act
            var endPointUrl = balancer.RequestChatServerEndpoint(login);

            // .Assert
            Assert.AreEqual(endPointUrl, "ws://action-1.unstable.livetex:19090");
        }
コード例 #2
0
ファイル: Operator.cs プロジェクト: wsbaser/automateit
        private WebSocket CreateSocket(Balancer balancer)
        {
            var chatServerEndPointUrl = balancer.RequestChatServerEndpoint(this.Login);
            var webSocket             = new WebSocket(chatServerEndPointUrl);

            webSocket.OnError   += this.OnError;
            webSocket.OnClose   += this.OnClose;
            webSocket.OnOpen    += this.OnOpen;
            webSocket.OnMessage += this.OnMessage;
            return(webSocket);
        }