[Implemented] Extended OpenNetworkConnection()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
HarryE
New User
New User
Posts: 9
Joined: Thu Aug 11, 2005 6:51 am
Location: Bucharest,Romania

[Implemented] Extended OpenNetworkConnection()

Post 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));
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post 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.
Post Reply