Results 1 to 3 of 3

Thread: Socket Assert

  1. #1
    Lesser Wizard
    Join Date
    Jun 2007
    Posts
    109

    Default Socket Assert

    Here's what I get:

    ClanLib Assert: \Network\Socket\socket_select.cpp:204

    'result != WSA_WAIT_FAILED && result != WAIT_IO_COMPLETION && result != WSA_WAIT_TIMEOUT && result >= WSA_WAIT_EVENT_0' failed.

    Here's what I'm doing:

    Setting up multiple threads listening on multiple ports. It tends to die out around the 7th - 15th port open (via net session start listen). My system is at 100% cpu usage, and it begins to crawl (the cout log begins to print letter by letter).

    Just not thread safe? Bad idea to listen on a lot of ports at once?

  2. #2
    Lesser Wizard
    Join Date
    Jun 2007
    Posts
    109

    Default

    Oddly this doesn't seem to happen as a result of the networking itself? It seems running many threads continuously combined with networking that causes it to crawl until it dies.

    For example, it's nice and speedy, so long as I keep killing the threads shortly after they are made.

    Is there a general limit on how many threads one should run simultaneously? After 5 or 6 it begins to noticeably crawl... but you wouldn't think it would.

    Sorry, I'm not terribly experienced with threads, so this is an experiment, more or less.

    Any insight is much appreciated.

  3. #3
    Lesser Wizard
    Join Date
    Jun 2007
    Posts
    109

    Default

    Well, I figured out the slow down was caused because I was not using keep_alive or sleep in the run callback of the thread. So that's fixed.

    With an initialized net session, though, the error remains. If I do not create a net session in this thread, it does not abort.
    Last edited by catch22; 07-20-2007 at 06:32 AM.

Similar Threads

  1. isspace() assert on Debug build
    By Fausto Junior in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 12-20-2006, 06:52 PM

Bookmarks

Bookmarks

Posting Permissions

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