Running 2 client programs simultaneously

Discussion in 'Perl Misc' started by janicehwang1325@yahoo.com, Jun 14, 2006.

  1. Guest

    hi expert,

    Currently, I have a server program running localhost. Then i have 2
    separate client programs that will connect to the server at the same
    time. However, my server program will only allow one client program to
    connect. If there is another program from the same IP connect, it will
    exit. Is it the program becoz of the client is using same identity to
    connect to the server making the server exit itself? FYI, i had tested
    the server progarm (it's multitaking using thread) and having
    connection from different user having no problem. If i would like to
    run the server to accept connections from clients from the same IP is
    that possible?
     
    , Jun 14, 2006
    #1
    1. Advertising

  2. Guest

    wrote:
    > However, my server program will only allow one client program to
    > connect. If there is another program from the same IP connect, it will
    > exit. Is it the program becoz of the client is using same identity to
    > connect to the server making the server exit itself?


    No. You have already diagnosed your problem:
    >>> my server program will only allow one client program to connect.


    Now you need to review your server program source code and figure out
    WHY that is so. There is no inherent limitation which prevents a server
    from accepting multiple connections from the same host (even from
    localhost), so there is apparently a limitation imposed by your server
    program's logic.

    By the way, "becoz" is spelled b-e-c-a-u-s-e. This newsgroup is more
    "professional" in tone than many others, and you might find that you
    will annoy many of the folks in this newsgroup if you use cutsie
    abbreviations (whereas you will annoy no one if you do not).

    --
    David Filmer (http://DavidFilmer.com)
     
    , Jun 14, 2006
    #2
    1. Advertising

  3. Guest

    So it's my server program problem that prevent the multiple connections
    from the same host? for your information, all the client and server
    program i run is running as daemon. when i try to run the server on
    another machine like 10.11.10.22 and the client at 10.11.10.11, it
    creates no problem. However, when i put the server same as the client
    at 10.11.10.11, the problem occur.

    I realized that the connection is done but the connection is gone once
    the second client connect to it and the error message that i can get is
    "segmentation fault (core dumped)". I tried to look into the code and
    now running the server program using different port number. The program
    is fine. However, i believe running using different port number isn't
    an ultimate solution.

    Thanks for the remind. I will be aware of my usage of abbreviation!

    wrote:
    > wrote:
    > > However, my server program will only allow one client program to
    > > connect. If there is another program from the same IP connect, it will
    > > exit. Is it the program becoz of the client is using same identity to
    > > connect to the server making the server exit itself?

    >
    > No. You have already diagnosed your problem:
    > >>> my server program will only allow one client program to connect.

    >
    > Now you need to review your server program source code and figure out
    > WHY that is so. There is no inherent limitation which prevents a server
    > from accepting multiple connections from the same host (even from
    > localhost), so there is apparently a limitation imposed by your server
    > program's logic.
    >
    > By the way, "becoz" is spelled b-e-c-a-u-s-e. This newsgroup is more
    > "professional" in tone than many others, and you might find that you
    > will annoy many of the folks in this newsgroup if you use cutsie
    > abbreviations (whereas you will annoy no one if you do not).
    >
    > --
    > David Filmer (http://DavidFilmer.com)
     
    , Jun 14, 2006
    #3
  4. wrote:
    > hi expert,


    Where?

    > Currently, I have a server program running localhost. Then i have 2
    > separate client programs that will connect to the server at the same
    > time. However, my server program will only allow one client program to
    > connect. If there is another program from the same IP connect, it will
    > exit.


    Well, you are not telling us what kind of server you are talking about. HTTP
    maybe?
    If so, then your observation is rather strange, because normally web servers
    would simply fork off a new thread or process to handle each incoming
    request and they don't care about how many requests a single requestor
    sends.

    > Is it the program becoz of the client is using same identity to
    > connect to the server making the server exit itself?


    I've never heard of a program becoz, maybe you can ask the manufacturer of
    this program?

    Anyway, what does this have to do with Perl?

    jue
     
    Jürgen Exner, Jun 14, 2006
    #4
  5. Guest

    for more information, my client and server program are both writing in
    Perl using IO::Socket::SSL. Both of them will be running as daemon.The
    server is actually split the log messages from different client and
    save into database according to their type.

    Jürgen Exner wrote:
    > wrote:
    > > hi expert,

    >
    > Where?
    >
    > > Currently, I have a server program running localhost. Then i have 2
    > > separate client programs that will connect to the server at the same
    > > time. However, my server program will only allow one client program to
    > > connect. If there is another program from the same IP connect, it will
    > > exit.

    >
    > Well, you are not telling us what kind of server you are talking about. HTTP
    > maybe?
    > If so, then your observation is rather strange, because normally web servers
    > would simply fork off a new thread or process to handle each incoming
    > request and they don't care about how many requests a single requestor
    > sends.
    >
    > > Is it the program becoz of the client is using same identity to
    > > connect to the server making the server exit itself?

    >
    > I've never heard of a program becoz, maybe you can ask the manufacturer of
    > this program?
    >
    > Anyway, what does this have to do with Perl?
    >
    > jue
     
    , Jun 14, 2006
    #5
    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. Replies:
    12
    Views:
    1,702
    Dave Thompson
    Jan 10, 2005
  2. Coca
    Replies:
    7
    Views:
    776
    Aidan Grey
    Aug 24, 2004
  3. Replies:
    18
    Views:
    656
    Dave Thompson
    Jan 10, 2005
  4. Olivier Matrot
    Replies:
    1
    Views:
    387
    bruce barker
    Sep 12, 2007
  5. ahd292
    Replies:
    6
    Views:
    438
Loading...

Share This Page