Servers created with NETACCEPTON cannot accept more
than one connection. When the a client attempts the
second connection, a message box that looks like this
is displayed.
I understand that FMSLogo does not support multiple
concurrent connections, but I think it should accept
connections in serial.
+-----------------------+
| accept(receivesock) X|
|-----------------------|
| |
| Invalid Argument |
| |
| ------ |
| | OK | |
| ------ |
| |
+-----------------------+
The problem seems to be that FMSLogo overwrites the
listen socket with the accept socket, so it can only
accept once.
How Reproducible:
Every Time
Steps to Reproduce
Run NETWORKTEST.SERVER.TWOCONNECTIONS from network.lgo
What Happens:
The test case displays the message described above,
then fails, saying it only received [[hello]], when
[[hello][hello]] was expected (the second "hello")
comes from the second connection, which never succeeded.
Expected Result:
The test passes.
This is fixed by [r5498]. The fix will be available in FMSLogo 8.0.0.
Now that this has been fixed, I have started work on a proof-of-concept HTTP server implemented in FMSLogo (perhaps to be used as simple a REST microservice). I had expected that multiple connections would seamlessly, but since FMSLogo's network API requires that there be no more than one connection at a time for the server (NETACCEPTON) socket, multiple concurrent connections can cause problems in ways that I haven't yet pinned down. However, because this fix enables NETACCEPTOFF to close the listen socket, it's always possible to run NETACCEPTOFF followed by NETACCEPTON on the same port to receive another connection.
Related
Commit: [r5498]