Page 1 of 1

[Implemented] Extended OpenNetworkConnection()

Posted: Fri Aug 12, 2005 6:40 am
by HarryE
I wish an OpenNetworkConnection(ServerName$, Port,[LocalIp],[LocalPort],[Timeout]) having these three optional parameters
And it could be renamed OpenTCPConnection.

For reducing the timeout when you want to re-open a connection with the same ends, one needs to use setsockopt(...)
eg:
setsockopt (S, SOL_SOCKET, SO_REUSEADDR, &i, sizeof (i));
setsockopt (S, SOL_SOCKET, SO_LINGER, &lng, sizeof (lng));

Then, for implementing LocalPort and LocalIp there is a need for calling bind(...)
before connect(...) eg:
bind (S, (struct sockaddr *) localend, sizeof (struct sockaddr));

Posted: Fri Aug 12, 2005 6:48 am
by Shannara
HMm, some of these things were requested for a bit now (since before 3.40/search). No word from Fred yet on whether he will complete/flesh out the net libs.