Răsfoiți Sursa

整理代码

tanghai 7 ani în urmă
părinte
comite
5ec6ce33f5

+ 4 - 2
Server/Model/Module/Message/Network/WebSocket/WChannel.cs

@@ -8,7 +8,7 @@ namespace ETModel
 {
     public class WChannel: AChannel
     {
-        private readonly HttpListenerWebSocketContext webSocketContext;
+        public HttpListenerWebSocketContext WebSocketContext { get; }
 
         private readonly WebSocket webSocket;
 
@@ -24,7 +24,7 @@ namespace ETModel
         {
             this.InstanceId = IdGenerater.GenerateId();
             
-            this.webSocketContext = webSocketContext;
+            this.WebSocketContext = webSocketContext;
 
             this.webSocket = webSocketContext.WebSocket;
             
@@ -40,6 +40,8 @@ namespace ETModel
             this.webSocket = webSocket;
             
             this.memoryStream = this.GetService().MemoryStreamManager.GetStream("message", ushort.MaxValue);
+
+            isConnected = false;
         }
 
         public override void Dispose()

+ 1 - 2
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs

@@ -172,8 +172,7 @@ namespace ETModel
 			e.RemoteEndPoint = null;
 			this.isConnected = true;
 			
-			this.StartRecv();
-			this.StartSend();
+			this.Start();
 		}
 
 		private void OnDisconnectComplete(object o)