-
2 Attachment(s)
Winsock
Hi
I am using Win32 with MFC support to establish client and server connection. I am using CSocket class to accomplish this task. I like to connect many clients to the server. But, when i connect 1 client and when the client which I have connected is inthe receive mode(blocking call), i try to accept the next client. But there when I connect the next client the first client automatically gets terminated. Please tell me how I wil be able to connect many clients......
The class MySocket is derived from CSocket class in both server and client
Hi,
Now I am able to connect multiple clients by chaing the CSocket as pointer. But I am having another problem. I make a client wait in the receive mode. That time I connect to another client. Now I take the SOCKET m_hSocket and attach to the CSocket connection pointer. That time when the function Attach executes, I get 'Unhandeled Exception'. I use Datach before Attach where the function Detach(detach calls kill socket inside the function). Then when I attach another SOCKET this error comes because attach calls AttachHandle where the prototype is
AttachHandle(SOCKET hSocket, CAsyncSocket* pSocket, BOOL bDead)
Here bDead is 0. This is not passed as an argument. Wen bDead is 1 there is no problem. What should I do in this case? Kindly help.
-
Re: Winsock
It is difficult to tell you without code, but you may need to choose a different socket model (async, select, iocp, etc) to effectively do what you want
-
Re: Winsock
Just Check out your Code once again i am not sure That you are using multithreading here or not. and how you are trying to connect the client and as calculator already mention show your code here.so anyone can help you.
thx