• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

"Random" server

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot... think I gotta redesign everything, and so even my understanding of stuff
Jonathas d-_-b
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic