Skip to content

Commit

Permalink
Update 0.1.9.0F
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyrotication committed Nov 30, 2018
1 parent 828e0ff commit b2590ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Project/Server/Classes/S_Client.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Project/Server/Forms/Main.vb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b2590ed

Please sign in to comment.