
Odd behavior by socket.select()
I'm seeing one odd bit of behavior coming from socket.select, and I'm
wondering if there's something that I'm doing wrong.
When I have one or two clients connected and send data, socket.select
returns a list containing only that socket as having data. When I add a
third (or more) client, socket.select returns a list with two sockets -
the second one, and whichever higher one actually has data.
Two clients, A & B
A sends data,
Socket.Select(readclient, nothing, nothing, 1000) returns
readclient containing [A]
B sends data,
Socket.Select(readclient, nothing, nothing, 1000) returns
readclient containing [B]
Add client C
C sends data,
Socket.Select(readclient, nothing, nothing, 1000) returns
readclient containing [B,C]
B.Available = 0
C.Available = (the amount of waiting data)
Any suggestions? Is this just a quirk? Currently I'm handling it by
simply ignoring any readclient items where there's not any data actually
pending, but it seems a bit odd - my understanding was that the only
time you should get that kind of thing is possibly when the client
disconnects.
ajm