aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Create Server Sockets using multiple ports Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Create Server Sockets using multiple ports" Watch "Create Server Sockets using multiple ports" New topic

Create Server Sockets using multiple ports

Abhijit Das
Ranch Hand

Joined: Sep 25, 2007
Posts: 156
I want to create sockets in the server code in two different port (say 2407,3004).One is used to receive from and other one to send to my clients.

Similarly, I want create the sockets in the client end using for the said purpose.

A brief code snippet will help.


Abhijit Das
SCJP 5.0 | SCWCD 1.5
Joe Ess

Joined: Oct 29, 2001
Posts: 8707

Sockets are two-way connections so you only need to connect once between a server and client. Have you looked at the Java Networking Tutorial?

"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Create Server Sockets using multiple ports
Similar Threads
Network Approaches
To JavaRanch Moderators
Multithreading a request in the server
Networked programing code
accessing a server using socket connection