Private Sub ListenForConnections
Do While working
server.Listen
Wait For Server_NewConnection (Successful As Boolean, NewSocket As Socket)
If Successful Then
CloseExistingConnection
client = NewSocket
astream.Initialize(client.InputStream, client.OutputStream, "astream")
UpdateState(True)
End If
Loop
End Sub