Просмотр исходного кода

去掉channel一个多余的send方法

tanghai 7 лет назад
Родитель
Сommit
31672e7d29

+ 1 - 7
Unity/Assets/Scripts/Module/Message/Network/AChannel.cs

@@ -1,5 +1,4 @@
 using System;
-using System.Collections.Generic;
 using System.IO;
 using System.Net;
 
@@ -70,12 +69,7 @@ namespace ETModel
 		}
 
 		public abstract void Start();
-
-		/// <summary>
-		/// 发送消息
-		/// </summary>
-		public abstract void Send(byte[] buffer, int index, int length);
-
+		
 		public abstract void Send(MemoryStream stream);
 		
 		public override void Dispose()

+ 1 - 1
Unity/Assets/Scripts/Module/Message/Network/KCP/KChannel.cs

@@ -390,7 +390,7 @@ namespace ETModel
 			this.GetService().AddToUpdateNextTime(0, this.Id);
 		}
 
-		public override void Send(byte[] buffer, int index, int length)
+		private void Send(byte[] buffer, int index, int length)
 		{
 			if (isConnected)
 			{

+ 0 - 17
Unity/Assets/Scripts/Module/Message/Network/TCP/TChannel.cs

@@ -95,23 +95,6 @@ namespace ETModel
 			this.StartRecv();
 			this.StartSend();
 		}
-
-		public override void Send(byte[] buffer, int index, int length)
-		{
-			if (this.IsDisposed)
-			{
-				throw new Exception("TChannel已经被Dispose, 不能发送消息");
-			}
-			
-			cache.WriteTo(0, (ushort)length);
-			this.sendBuffer.Write(this.cache, 0, this.cache.Length);
-			this.sendBuffer.Write(buffer, index, length);
-
-			if(!this.isSending)
-			{
-				this.StartSend();
-			}
-		}
 		
 		public override void Send(MemoryStream stream)
 		{