Exemplo n.º 1
0
        public ICommandTransmit GetOrCreateConnection()
        {
            if (Connection == null)
            {
                var url = ConfigController.GetUrl("socket", ConfigController.WebProtocol.wss, this.Id.ServerId);
                // create a new connection
                Connection = new ClientSocket(new WebSocketSharp.WebSocket(url));
                Connection.AddCallback(m => CoflnetCore.Instance.ReceiveCommand(m));
            }

            return(Connection);
        }
Exemplo n.º 2
0
 public static ClientSocket NewInstance()
 {
     return(new ClientSocket(new WebSocket(ConfigController.GetUrl("socket", ConfigController.WebProtocol.wss))));
 }