Menu

#2 Socket class development

open
nobody
None
5
2004-10-11
2004-10-11
Anonymous
No

What about a possibility to monitor a few sockets by 1
wait call? (wrapper for select() socket API proc)

for example:

// we use flags pendingInput, pendingOutput, sockError
(!!! add this also, please)

class Socket : public xxxx {
...
static int select(Socket* s1, int* f1, Socket* s2 =
NULL, int timeout, ...);
...
}

----------
and using like that:

Socket* s_client, s_server.
int f_client, f_server;

f_client = f_server = pendingInput | pendingOutput |
sockError;

int n = Socket::select(s_client, &f_client, s_server,
&f_server, NULL, MY_TIMEOUT);

if(f_client) {
// proccess client socket
}

// and so on?

-----------
it would be nice to add that feature.

Regards, Dmitry.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.