Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another sockets question

Status
Not open for further replies.

Valius

Programmer
Oct 20, 2000
174
US
I've been racking my brains out here trying to figgure out the logic to this...maybe I'm going about it the wrong way. Here is my problem:

Let's say we have a server and two clients connected to the server. One of these clients sends a message to the server which, in turn, fires the OnReceive() function. Now, how can I tell which client sent the data so I can poll that socket? All I know is that the OnReceive() function has fired. I have an array of CAsyncSocket derived objects. Each client that connects to the server is added to the array. Well, when the OnReceive() function goes off...I don't know which element of the CAsyncSocket derived array to use Receive() on. One thing I was thinking was to just do a peek on each array element...but that seems to defeat the purpose and I could see some potential problems down the road. Am I going about this the wrong way? If my logic is completely screwed up, don't hesitate to tell me, I don't get offended....not too easily anyway :)

Thanks in advance

Niky Williams
NTS Marketing
Niky.Williams@NTSMarketing.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top