Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  UDP: Port unreachable  (Read 3243 times)
0 Members and 1 Guest are viewing this topic.
Offline darcone

Junior Devvie

Size matters

« Posted 2003-11-24 18:31:09 »

Hey again...
So I finally made my game work with UDP, from localhost to localhost =/
When I try to play over a network, I get ICMP messages back telling me that the port is unreachable (tried it with ethereal).

I start the UDP server on port 27901, and send UDP packets there... I tried it with port 9001 as well.

Anyone got a idea?
Offline endolf

JGO Coder

Medals: 7
Exp: 15 years

Current project release date: sometime in 3003

« Reply #1 - Posted 2003-11-24 18:56:56 »

 What interface are you listening on at the receiving end(s) ?, if you are on linux, can you use nc to conenct to that udp port?, can you ping the machine, are they both on the local lan, or is one outside it?



Offline darcone

Junior Devvie

Size matters

« Reply #2 - Posted 2003-11-24 20:26:09 »

I tried with a test program to open a socket and send data to it and it worked from localhost to localhost... How would I try to send/get data with nc ?

Perhaps I am binding the socket wrong? Maybe java is doing some security checks that only allows localhost to send data to it?

channel =;
                ((DatagramChannel)channel).socket().bind(inetAddress = new InetSocketAddress("localhost", port));
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline darcone

Junior Devvie

Size matters

« Reply #3 - Posted 2003-11-24 20:52:58 »

yeah that was it, I removed the "localhost" and now it works Wink thanks
Offline elias

Senior Devvie

« Reply #4 - Posted 2003-11-25 03:58:08 »

I'm no UDP expert here, but it looks like you tried to bind the listening socket to the localhost interface. No packet can reach that interface except those coming from the same machine. Removing it made your socket bind to all interfaces available on your system, that is, the local interface and any adapter interfaces. In short, I don't think it was a security measure :-)

- elias

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

basil_ (42 views)
2015-09-30 17:04:40

shadowstryker (21 views)
2015-09-29 15:55:06

TheSpaceHedgehog (27 views)
2015-09-29 01:58:48

GamerC4 (50 views)
2015-09-24 21:10:38

GamerC4 (70 views)
2015-09-24 21:09:48

htuy (25 views)
2015-09-24 04:57:24

htuy (35 views)
2015-09-24 04:56:35

htuy (25 views)
2015-09-24 04:56:09

htuy (26 views)
2015-09-24 04:47:33

Roquen (63 views)
2015-09-21 12:54:28
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!