• Post Reply Bookmark Topic Watch Topic
  • New Topic

"Random" server  RSS feed

 
Jonathas Carrijo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have no experience with networking in Java, so I think mine is a newby question.
This is my situation. I'm writing a ping-pong game (applet) just for practice and learning. And the intention is for two people to compete each one from his computer. The Stream class constructor requires a server name and a port. Since I'd like to connect any two machines to get playing, I do not want to specify the server name at coding-time... How do I handle this?
Thanks a lot,
Jonathas d-_-b
 
Paul Frey
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applet security restrictions only allow communications with originating server that delivered the applet. When I've needed to allow two or more separate users to interact across the net via an applet, I had to write a server based Java application that listens for requests from applets. It would act as a conduit, passing messages between each applet. An example of this would be a Chat applet client and Chat server.
 
Jonathas Carrijo
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot... think I gotta redesign everything, and so even my understanding of stuff
Jonathas d-_-b
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!