Skip to content
This repository was archived by the owner on Feb 19, 2023. It is now read-only.

Commit 1c8cde5

Browse files
committed
refactor: inline Write() & Read()
1 parent 34e61ad commit 1c8cde5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

TcpClient.vb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,14 @@ Public Class TcpClient
3535

3636
Private Function Command(cmd As Byte()) As Byte()
3737
' Send a command to the server and return the response.
38-
Write(cmd)
39-
Return Read()
40-
End Function
4138

42-
Private Sub Write(cmd As Byte())
39+
' send the command
4340
_networkStream.Write(cmd, 0, cmd.Length)
44-
End Sub
4541

46-
Private Function Read() As Byte()
42+
' read the response
4743
Dim response(_tcpClient.ReceiveBufferSize) As Byte
4844
_networkStream.Read(response, 0, CInt(_tcpClient.ReceiveBufferSize))
45+
4946
Return response
5047
End Function
5148
End Class

0 commit comments

Comments
 (0)