Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (672)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
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 3441 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.

IanParcs (50 views)
2016-04-18 14:18:53

KaiHH (48 views)
2016-04-18 08:35:41

KaiHH (79 views)
2016-04-15 12:43:58

theagentd (82 views)
2016-04-14 02:16:17

theagentd (97 views)
2016-04-14 02:15:43

IanParcs (111 views)
2016-04-12 03:51:16

IanParcs (50 views)
2016-04-12 03:50:03

IanParcs (47 views)
2016-04-12 03:49:54

IanParcs (44 views)
2016-04-12 03:49:52

IanParcs (52 views)
2016-04-12 03:49:52
Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30 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!