View Single Post
Old Dec 5th, 2007, 6:15 PM   #2
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 824
Rep Power: 4 The Dark is on a distinguished road
Re: Winsock: specified sending

I don't think you want to exit the loop when you hit "i" - that would only send the message to the portion of the users whose socket was less than the sender.
I think something like this should work in the inner if statement:
c++ Syntax (Toggle Plain Text)
  1. ...
  2. {
  3. // if the sending socket is equal to the socket receiving the message, don't send.
  4. if(j != i)
  5. send(j, recvbuf, bytes, 0);
  6. }
  7. ...
The Dark is offline   Reply With Quote