Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Using SOcket programing to create multiple clients conatcting a single server (http://www.velocityreviews.com/forums/t388538-using-socket-programing-to-create-multiple-clients-conatcting-a-single-server.html)

zigbeedeep@gmail.com 11-11-2006 09:36 PM

Using SOcket programing to create multiple clients conatcting a single server
 
Hello,

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

Is a multiclient possible if possible how?

Thank You


Karl Uppiano 11-11-2006 10:09 PM

Re: Using SOcket programing to create multiple clients conatcting a single server
 

<zigbeedeep@gmail.com> wrote in message
news:1163280979.656200.171760@b28g2000cwb.googlegr oups.com...
> 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/...verSocket.html
http://java.sun.com/j2se/1.5.0/docs/...ng/Thread.html

If you need really high performance:
http://java.sun.com/j2se/1.5.0/docs/...e-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...



Lew 11-12-2006 04:08 PM

Re: Using SOcket programing to create multiple clients conatctinga single server
 
zigbeedeep@gmail.com 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


All times are GMT. The time now is 08:41 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.