CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Winsock

Threaded View

  1. #1
    Join Date
    Mar 2007
    Posts
    2

    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.
    Attached Files Attached Files
    Last edited by saranyas; March 20th, 2007 at 06:12 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured