This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes Client server program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Client server program" Watch "Client server program" New topic
Author

Client server program

Madhumitha Baskaran
Ranch Hand

Joined: Feb 27, 2010
Posts: 66
Hi,

I want to create a peer which is client as well as server. I am able to use threads to create server to handle many requests. But I should be able to create one more thread which will work as client in the same peer. How to create such different types of threads. I am not able to find out. Please help me.

Thanks,
Madhu
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12682
    
    5
As far as a Thread is concerned, it doesn't care whether the code it executes is acting as a client or a server.

You will probably find it easier to develop the classes for server and client separately - once you have verified they are working correctly, then work on the application combining both functions.

Bill

Java Resources at www.wbrogden.com
 
Don't get me started about those stupid light bulbs.
 
subject: Client server program
 
Similar Threads
Dating association and dependency
closing client threads in chat program
Live Audio/Video Webcam between 2 users in website?
SOAP and java.net.SocketException
Multiple threads writing and reading from single socket