Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

Using SOcket programing to create multiple clients conatcting a single server

Thread view: 
zigbeedeep@gmail.com - 11 Nov 2006 21:36 GMT
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 Nov 2006 22:09 GMT
> Hello,
>
[quoted text clipped - 3 lines]
>
> 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...
Lew - 12 Nov 2006 16:08 GMT
> Hello,
>
[quoted text clipped - 3 lines]
>
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.