At 02:53 PM 11/14/2005, you wrote:
I'm wondering how to avoid getting this error
(netErrTooManyTCPConnections) when doing a SocketConnect.
It seems like I must not be closing connections properly, because every
time I make a connection, I immediately transfer data, receive data, and
close the connection. However, doing this many times in a row leads to
the netErrTooManyTCPConnections upon calling SocketConnect. The only way
to make a SocketConnect after that is to wait several minutes (5 or so
seems to work), or to reset the device.
When I close the connection, these are the function calls that I make:
NetLibSocketShutdown(AppNetRefnum,g_socket,netSocketDirOutput,SysTicksPerSecond()
* 10, &err);
NetLibSocketClose(AppNetRefnum, g_socket, SysTicksPerSecond() * 10, &err);
NetLibClose(AppNetRefnum,false);
Is there something I'm doing wrong?
Connections default to linger mode, where the net library keeps them open
for a short period of time in case more packets arrive.
Look at the documentation for NetLibSocketOptionSet and the SockLinger
option in the SDK Reference and Programmer's Guide.
-- Ben Combee, Senior Software Engineer, Palm, Inc.
"Combee on Palm OS" weblog: http://palmos.combee.net/
Developer Forum Archives: http://news.palmos.com/read/all_forums/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/