2 Replies - 416 Views - Last Post: 21 April 2013 - 12:54 PM Rate Topic: -----

#1 ulxlx  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-April 13

Winsock program hangs when using accept().

Posted 20 April 2013 - 10:02 AM

Hey all, I'm trying to make a multiplayer game, and I'm currently having issues where my program stops functioning whenever I try to call the accept() function of winsock. My code is here: http://pastebin.com/HGhDgV4k (The code in question starts at line 436, and the call that breaks it is at 477. When I debug it it gets to that point, and then when that is called is just freezes, the little arrow that normally shows where the code is currently at disappears and I'm not really sure what happens. Sorry if I'm explaining this terribly, if more explanation is needed just tell me.
Thanks for your time!
-Ulxlx

Is This A Good Question/Topic? 0
  • +

Replies To: Winsock program hangs when using accept().

#2 jimblumberg  Icon User is offline

  • member icon


Reputation: 4098
  • View blog
  • Posts: 12,681
  • Joined: 25-December 09

Re: Winsock program hangs when using accept().

Posted 20 April 2013 - 07:19 PM

Please post your code in code tags, don't make us go elsewhere to get your code.


Jim
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3589
  • View blog
  • Posts: 11,159
  • Joined: 05-May 12

Re: Winsock program hangs when using accept().

Posted 21 April 2013 - 12:54 PM

Calling accept() is supposed to block.

From MSDN, see second paragraph of the Remarks: http://msdn.microsof...6(v=vs.85).aspx

From 'man accept 3': see penultimate paragraph of the Description: http://linux.die.net/man/3/accept
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1