quddusaliquddus
Active member
- Joined
- Nov 20, 2007
- Messages
- 25
- Programming Experience
- Beginner
Hi! I am writing a server application. A thread is created which runs the code snippet below.
Q [1] Will this accept multiple clients? (I am unable to test this as I only have access to one PC). If not, then how can I modify it to do so?
Q [2] How can I test multiple clients for a server one one PC running the server?
Thanks
quddusaliquddus
Q [1] Will this accept multiple clients? (I am unable to test this as I only have access to one PC). If not, then how can I modify it to do so?
Q [2] How can I test multiple clients for a server one one PC running the server?
Thanks
quddusaliquddus
VB.NET:
Listener.Start()
While Listener.Pending = False
Client = Listener.AcceptTcpClient()
Dim Stream As NetworkStream = Client.GetStream()
While Stream.CanRead
Dim Header As Byte() = New Byte(1) {}
Stream.Read(Header, 0, 2)
Dim DataPackage As Byte() = New Byte() {}
While (DataPackage.Count - 1 < Header(0))
DataPackage = New Byte(Header(0)) {}
Stream.Read(DataPackage, 0, DataPackage.Count)
End While
Select Case Header(1)
Case 0
Case 1
Case 2
End Select
End While