Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Writing a server and client in the same class

843790Jan 30 2008 — edited Feb 9 2008
Hi guys,
I'm trying to combine a server and client together into one class. Basicly I'm stuck for when I have to listen to the port I have chosen and also connect etc. I was wondering if anyone has any advice etc as the application I'm writing is supposed to be both a server and a client and this project will be a peer to peer game.

I'm willing to post the code for the server and client which I have written already but it's just confusing on how to combine them as this is the first networking java application I've done.

Let me know if anyone wants any more info :)

Thanks,
Ben
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 8 2008
Added on Jan 30 2008
6 comments
444 views