コード例 #1
0
ファイル: CoflnetServer.cs プロジェクト: Coflnet/cloud
        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);
        }
コード例 #2
0
 public static ClientSocket NewInstance()
 {
     return(new ClientSocket(new WebSocket(ConfigController.GetUrl("socket", ConfigController.WebProtocol.wss))));
 }