From fba3fb5355a573a3525b2bb7ef78839c8fb835f6 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Mon, 10 Apr 2023 21:11:17 +0000 Subject: [PATCH] Add 'Home' --- Home.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Home.md diff --git a/Home.md b/Home.md new file mode 100644 index 0000000..01f374b --- /dev/null +++ b/Home.md @@ -0,0 +1,24 @@ +## Gotchas + +### Servers + +* After you Accept a connection from a client, you need to watch the new socket for that client for updates, rather than the original server socket: + +```vb6 +Do + RESULT=Socket Wait Async Reading(SERVER, 500) + + If RESULT > 0 + _REMOTE_SOCKET=Socket Accept(SERVER) + + ' For all communication with this client, use this socket, not the SERVER socket + Do + RESULT=Socket Wait Async Reading(_REMOTE_SOCKET, 500) + If RESULT > 0 + Print Socket Recv$(_REMOTE_SOCKET, 1024) + End If + Wait Vbl + Loop + End If +Loop +``` \ No newline at end of file