This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Socket & NAT technologie

 
ouadie lahdioui
Greenhorn
Posts: 1
C++ Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi EveryOne ,
I need to create a programme based on JAVA Socket , thts normal !
but my client connected behind a router , i mean tht is use NAT Technologie to connect to Internet .
can somme one Help me ?

 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your Java program doesn't know or care about the NAT. You write your code exactly the same way as if there was no NAT.
 
Henry Wong
author
Marshal
Pie
Posts: 20836
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ouadie lahdioui wrote:Hi EveryOne ,
I need to create a programme based on JAVA Socket , thts normal !
but my client connected behind a router , i mean tht is use NAT Technologie to connect to Internet .
can somme one Help me ?



Please search for previous topics -- as this question has come up before.

Basically, if your client (who is behind the router) is the socket initiator, you should have no problems. However, if the client is the socket acceptor, then (1) you need your server to connect to the router instead of the client machine, and (2) you need to configure the router to forward the particular port to the client machine.

Henry
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic