A strange problem(about socket tcp connection)~~~ - Networking

This is a discussion on A strange problem(about socket tcp connection)~~~ - Networking ; Hi, everyone I have a problem when developing a server. It really troubles me for a very long time. The server's socket-connection is working undering Asynchronize-mode(linger time is 30 seconds). One accept-thread accept new request socket, and then pass the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: A strange problem(about socket tcp connection)~~~

  1. A strange problem(about socket tcp connection)~~~

    Hi, everyone

    I have a problem when developing a server.
    It really troubles me for a very long time.

    The server's socket-connection is working undering Asynchronize-mode(linger
    time is 30 seconds).

    One accept-thread accept new request socket, and then pass the file-handle
    to other work threads(several ones).

    When the Server is working under heavy pressure, for example > 30
    requests/second,
    it will only work for several hours.
    And after that the new TCP connections can't be connected anymore.

    At server side, the status is SYN_RECV(and then be closed as TIMEOUT); at
    the client side, the status is ESTABLISHED.

    Function accept() can't create any new socket anymore!!!

    ~~~More strange is, each time when I use "gdb" attach the working process,
    and quit debug at once(nothing else be done before quit),
    the Server's status will be unlocked, it gets back into normally working
    status!!!


    WHAT'S THE TROUBLE?

    PLS give me any help

    THANKS

    Harry
    06/22/2007



  2. Re: A strange problem(about socket tcp connection)~~~



    "Harry" 写入消息新闻:f5god6$qe4$1@news.yaako.com...
    > Hi, everyone
    >
    > I have a problem when developing a server.
    > It really troubles me for a very long time.
    >
    > The server's socket-connection is working undering
    > Asynchronize-mode(linger time is 30 seconds).
    >
    > One accept-thread accept new request socket, and then pass the file-handle
    > to other work threads(several ones).
    >
    > When the Server is working under heavy pressure, for example > 30
    > requests/second,
    > it will only work for several hours.
    > And after that the new TCP connections can't be connected anymore.
    >
    > At server side, the status is SYN_RECV(and then be closed as TIMEOUT); at
    > the client side, the status is ESTABLISHED.
    >
    > Function accept() can't create any new socket anymore!!!
    >
    > ~~~More strange is, each time when I use "gdb" attach the working process,
    > and quit debug at once(nothing else be done before quit),
    > the Server's status will be unlocked, it gets back into normally working
    > status!!!
    >
    >
    > WHAT'S THE TROUBLE?
    >
    > PLS give me any help
    >
    > THANKS
    >
    > Harry
    > 06/22/2007
    >
    >




  3. Re: A strange problem(about socket tcp connection)~~~

    Harry wrote:
    >
    >
    > "Harry" 写入消息新闻:f5god6$qe4$1@news.yaako.com...
    >> Hi, everyone
    >>
    >> I have a problem when developing a server.
    >> It really troubles me for a very long time.
    >>
    >> The server's socket-connection is working undering
    >> Asynchronize-mode(linger time is 30 seconds).
    >>
    >> One accept-thread accept new request socket, and then pass the file-handle
    >> to other work threads(several ones).
    >>
    >> When the Server is working under heavy pressure, for example > 30
    >> requests/second,
    >> it will only work for several hours.
    >> And after that the new TCP connections can't be connected anymore.
    >>
    >> At server side, the status is SYN_RECV(and then be closed as TIMEOUT); at
    >> the client side, the status is ESTABLISHED.
    >>
    >> Function accept() can't create any new socket anymore!!!
    >>
    >> ~~~More strange is, each time when I use "gdb" attach the working process,
    >> and quit debug at once(nothing else be done before quit),
    >> the Server's status will be unlocked, it gets back into normally working
    >> status!!!
    >>
    >>
    >> WHAT'S THE TROUBLE?
    >>
    >> PLS give me any help
    >>
    >> THANKS
    >>
    >> Harry
    >> 06/22/2007
    >>


    You have a programming bug somewhere, e.g. you write where you have not
    malloc'd.

    Robert

+ Reply to Thread