Using SOcket programing to create multiple clients conatcting a single server

Z

zigbeedeep

Hello,

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

Is a multiclient possible if possible how?

Thank You
 
K

Karl Uppiano

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...
 
L

Lew

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top