3

I'm trying to write a multiplayer realtime game and run it on CloudBees (the client side is an applet, the server side a java web application). Is it possible to give the server permission to listen on another port? (ie so the server-side code can create a ServerSocket on that port and the client side code can create a Socket to connect and communicate with the server)

dspyz
  • 5,280
  • 2
  • 25
  • 63

1 Answers1

2

Whilst it may be possible it is quite tricky as the available port is likely to change as your app moves around. On top of this - you would need to locate the address of the instance of where your app is running (ie some kind of dynamic directory) - so kind of fiddly. The web routing layer does all this for you - but presumes http or similar (you can use "long poll" and keep a connection open from an applet - this could work in a similar way, with some work).

Michael Neale
  • 19,248
  • 19
  • 77
  • 109
  • I can have the application poll whatismyip.com to determine its ip address. Then it passes that as a parameter to the applet. What open port are you talking about? – dspyz Sep 23 '11 at 16:30