Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Client Server problem!!!

Client Server problem!!!

Scheduled Pinned Locked Moved C / C++ / MFC
helpsysadminquestion
2 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hkl
    wrote on last edited by
    #1

    Hi, In my program, I've used multithread (many clients) to send message to one thread(Server). However, I realized that only the first client can get access to the server from start to end, other clients are blocked. Can anyone help me to solve this problem?? The following is the code of the server: if ( svrSocket.Accept(socket)) AfxMessageBox("Socket is created Succesfully"); while (...) flag = socket.Receive(buff,sizeof(buff)); .... Please HELP! Thank you!!

    W 1 Reply Last reply
    0
    • H hkl

      Hi, In my program, I've used multithread (many clients) to send message to one thread(Server). However, I realized that only the first client can get access to the server from start to end, other clients are blocked. Can anyone help me to solve this problem?? The following is the code of the server: if ( svrSocket.Accept(socket)) AfxMessageBox("Socket is created Succesfully"); while (...) flag = socket.Receive(buff,sizeof(buff)); .... Please HELP! Thank you!!

      W Offline
      W Offline
      wangyiming
      wrote on last edited by
      #2

      while( ...) { if ( svrSocket.Accept(socket)) { CSockThread sockThread = new CSockThread(sock); // class CSockThread : CWinThread } } Receive in Thread while (...) flag = socket.Receive(buff,sizeof(buff)); ....

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups