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
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