Multithreaded server : Problem with WSAEventSelect

Discussion in 'C++' started by NaeiKinDus, Mar 6, 2007.

  1. NaeiKinDus

    NaeiKinDus Guest

    Hi there :)

    I'm trying to code a webserver running under WinXP, multithreaded,
    etc...
    The creation of my threads, the handles, everything works fine except
    this : the WSAEventSelect.

    The first occurence of this function is in the main() and manages
    connections. If a connection is accepted, it sends the newly created
    socket to a thread that will handle both FD_WRITE and FD_READ...
    Here's the prob : the second call to the WSAEventSelect fails and
    returns WSAENOTSOCK...
    I tried to send data thru that socket, and it worked...
    What's the deal?
    I tried the solution MSDN gave me, with WSAEventSelect(socket, NULL,
    0); before setting the thing to FD_READ | FD_WRITE but it still won't
    work...

    Got an idea ?

    Thanks.
     
    NaeiKinDus, Mar 6, 2007
    #1
    1. Advertising

  2. NaeiKinDus

    Lionel B Guest

    On Tue, 06 Mar 2007 03:39:30 -0800, NaeiKinDus wrote:

    > Hi there :)
    >
    > I'm trying to code a webserver running under WinXP, multithreaded,
    > etc...
    > The creation of my threads, the handles, everything works fine except
    > this : the WSAEventSelect.


    [snip]

    Afraid both threading and platform-specific details are off-topic here -
    this ng deals purely with C++ *language* issues.

    > Got an idea ?


    Perhaps you can find a better forum here:

    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9

    --
    Lionel B
     
    Lionel B, Mar 6, 2007
    #2
    1. Advertising

  3. NaeiKinDus

    NaeiKinDus Guest

    On 6 mar, 14:57, Lionel B <> wrote:
    > On Tue, 06 Mar 2007 03:39:30 -0800, NaeiKinDus wrote:
    > > Hi there :)

    >
    > > I'm trying to code a webserver running under WinXP, multithreaded,
    > > etc...
    > > The creation of my threads, the handles, everything works fine except
    > > this : the WSAEventSelect.

    >
    > [snip]
    >
    > Afraid both threading and platform-specific details are off-topic here -
    > this ng deals purely with C++ *language* issues.
    >
    > > Got an idea ?

    >
    > Perhaps you can find a better forum here:
    >
    > http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9
    >
    > --
    > Lionel B


    Sorry for the bother.
     
    NaeiKinDus, Mar 6, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BBryant

    WSAEventSelect Help

    BBryant, Mar 16, 2005, in forum: C++
    Replies:
    4
    Views:
    2,944
    modemer
    Mar 16, 2005
  2. John Lull

    Multithreaded COM server problem...

    John Lull, Jan 10, 2004, in forum: Python
    Replies:
    10
    Views:
    3,507
    Mark Hammond
    Jan 21, 2004
  3. Sidd
    Replies:
    7
    Views:
    1,329
  4. sberry
    Replies:
    1
    Views:
    305
    sberry
    Dec 13, 2007
  5. Gerhard Häring

    Non-evil multithreaded WSGI server?

    Gerhard Häring, Aug 26, 2008, in forum: Python
    Replies:
    0
    Views:
    354
    Gerhard Häring
    Aug 26, 2008
Loading...

Share This Page