Using SOcket programing to create multiple clients conatcting a single server

Discussion in 'Java' started by zigbeedeep@gmail.com, Nov 11, 2006.

  1. Guest

    Hello,

    How do I decide the port numbers for each of the client.

    Is a multiclient possible if possible how?

    Thank You
     
    , Nov 11, 2006
    #1
    1. Advertising

  2. Karl Uppiano Guest

    <> wrote in message
    news:...
    > Hello,
    >
    > How do I decide the port numbers for each of the client.
    >
    > Is a multiclient possible if possible how?
    >
    > Thank You


    This is all the information I ever needed to do this:
    http://java.sun.com/j2se/1.5.0/docs/api/java/net/ServerSocket.html
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html

    If you need really high performance:
    http://java.sun.com/j2se/1.5.0/docs/api/java/nio/channels/package-summary.html

    I had to search www.java.sun.com for tutorials and sample code before I
    could implement NIO sockets. But 63 connections on a single thread is
    sweet...
     
    Karl Uppiano, Nov 11, 2006
    #2
    1. Advertising

  3. Lew Guest

    Re: Using SOcket programing to create multiple clients conatctinga single server

    wrote:
    > Hello,
    >
    > How do I decide the port numbers for each of the client.
    >
    > Is a multiclient possible if possible how?
    >
    > Thank You


    ServerSocket on the server binds to a specific port, say 2048 for example.

    Each client will attempt to connect to "server:2048"; they all connect to the
    same host port.

    The server may spawn threads, one per client, to handle individual connections
    for performance's sake.

    - Lew
     
    Lew, Nov 12, 2006
    #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. chandu
    Replies:
    3
    Views:
    415
    Matt Humphrey
    Mar 2, 2006
  2. Francesco
    Replies:
    1
    Views:
    549
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Dec 27, 2006
  3. pmm

    Port Delegation in Socket Programing

    pmm, Oct 5, 2006, in forum: C Programming
    Replies:
    1
    Views:
    294
    Walter Roberson
    Oct 5, 2006
  4. Sean
    Replies:
    6
    Views:
    403
    bjeremy
    Jan 16, 2007
  5. Clement

    help in socket programing

    Clement, Nov 2, 2007, in forum: C Programming
    Replies:
    1
    Views:
    363
    Default User
    Nov 2, 2007
Loading...

Share This Page