This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java UDP Port Forwarding Using Cling Library  RSS feed

Mallek Amir
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a java game that includes multiplayer ,i want every player can host his own server in his computer and invite other players in,the problem here that 80% of players are behind routers so their routers drop the packets, the solution here is every player needs to manually port forward his router, which is a bad idea if the users are the average Joe and Jane.I am found many upnp port forwarding Java libraries over the web such as Cling, Weupnp and shabby-upnplib, I gave Cling a try, I added
''cling-core-2.0.1-sources" and
"cling-support-1.0.3" and
" seamless-util-1.1.0" to the build path in Eclipse and this basic up ping pong code

Server Class

Client Class

Eclipse gives me this error :
The type org.teleal.cling.registry.DefaultRegistryListener cannot be resolved. It is indirectly referenced from required .class files
under :
Other problems and questions in my mind :
-does only the host player require port forwarding ? or the clients must do it to ?
-is my implementation for the port mapping are correct ?
-the game works perfectly under "localhost" (without port forwarding ) the clients and the server can talk to each other .
this is my first time working with UDP or network in general in java and i think am losing hope and deleting the multiplayer idea from my head
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!