From b2590ed030f45cd1dff39a86e3cf7cbec665263e Mon Sep 17 00:00:00 2001 From: NYAN CAT Date: Thu, 29 Nov 2018 18:41:52 -0800 Subject: [PATCH] Update 0.1.9.0F --- Project/Server/Classes/S_Client.vb | 24 ++++++++++++------------ Project/Server/Forms/Main.vb | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Project/Server/Classes/S_Client.vb b/Project/Server/Classes/S_Client.vb index 44dfac7..2f68b6c 100644 --- a/Project/Server/Classes/S_Client.vb +++ b/Project/Server/Classes/S_Client.vb @@ -11,7 +11,7 @@ Public Class S_Client Public Received As Integer = 1024 * 100 Public Buffer(Received) As Byte Public MS As MemoryStream = Nothing - 'Public Shared Event Read(ByVal C As S_Client, ByVal b() As Byte) + Public Shared Event Read(ByVal C As S_Client, ByVal b() As Byte) Sub New(ByVal CL As Socket) Me.C = CL @@ -31,8 +31,8 @@ Public Class S_Client re: If BS(MS.ToArray).Contains(S_Settings.EOF) Then Dim A As Array = Await fx(MS.ToArray, S_Settings.EOF) - ' RaiseEvent Read(Me, A(0)) - Threading.ThreadPool.QueueUserWorkItem(New Threading.WaitCallback(AddressOf BeginRead), A(0)) + RaiseEvent Read(Me, A(0)) + ' Threading.ThreadPool.QueueUserWorkItem(New Threading.WaitCallback(AddressOf BeginRead), A(0)) MS.Dispose() MS = New MemoryStream @@ -52,9 +52,9 @@ re: End Try End Sub - Sub BeginRead(ByVal A As Array) - S_Messages.Read(Me, A) - End Sub + 'Sub BeginRead(ByVal A As Array) + ' S_Messages.Read(Me, A) + 'End Sub Delegate Sub _isDisconnected() Sub isDisconnected() @@ -119,13 +119,13 @@ re: End If End Sub - Sub Send(ByVal b As Byte()) - If IsConnected Then - Threading.ThreadPool.QueueUserWorkItem(New Threading.WaitCallback(AddressOf _BeginSend), b) - End If - End Sub + 'Sub Send(ByVal b As Byte()) + ' If IsConnected Then + ' Threading.ThreadPool.QueueUserWorkItem(New Threading.WaitCallback(AddressOf _BeginSend), b) + ' End If + 'End Sub - Sub _BeginSend(ByVal b As Byte()) + Sub Send(ByVal b As Byte()) Try C.Poll(-1, SelectMode.SelectWrite) C.BeginSend(b.ToArray, 0, b.Length, SocketFlags.None, New AsyncCallback(AddressOf EndSend), C) diff --git a/Project/Server/Forms/Main.vb b/Project/Server/Forms/Main.vb index 7b3b5ec..cfd7172 100644 --- a/Project/Server/Forms/Main.vb +++ b/Project/Server/Forms/Main.vb @@ -77,7 +77,7 @@ Public Class Main End Try Try - ' AddHandler S_Client.Read, AddressOf S_Messages.Read + AddHandler S_Client.Read, AddressOf S_Messages.Read For Each x In S_Settings.PORT.ToList S = New S_TcpListener Dim T As New Threading.Thread(AddressOf S.Start)