At 12:48 PM -0800 2000/01/17, Alexander Hinds wrote:
>I'm working on a TCP/IP Palm app that opens and closes *a lot* of sockets.
>Unfortunately I'm running into a problem such that after approximately 15
>"transactions", the next time I try to call NetLibSocketConnect() after
>creating the socket (without any error) it returns
>"netErrTooManyTCPConnections" (The app works fine in the emulator, but not
>with the Palm modem).
At 4:22 PM -0800 2000/01/17, [EMAIL PROTECTED] wrote:
>I talked to a Palm engineer and he said that's what Palm's code does as a
>workaround.
At 4:53 PM -0800 2000/01/17, Alexander Hinds wrote:
>any idea if this will be fixed in a future version of the os? ;-)
Well, it's not really "broken" per se... but it is an annoyance.
Closed sockets conventionally stick around for a few minutes to complete the last
transfer of data pending (if any, in either direction) before the socket is closed.
These "lingering" connections require memory and resources which are extremely limited
on a Palm OS device, which has a hard-coded limitation of 4 simultaneously active
sockets. A lingering socket is an active socket as far as the IP stack is concerned.
Setting the SO_LINGER option to 0 is the correct work-around, but may have an
unavoidable side-effect of closing the socket too abruptly for the other end of the
connection. The other end may see the close as an "error" as opposed to a "normal"
socket close, which may or may not have reliably completed the last data transfer
transaction. YMMV.
Regards,
Jim Schram
3Com/Palm Computing
Partner Engineering