horrible socket connection problem....

this looks like an impossible problem.

my school's LAN is mismanaged.

but please take a look:

i cannot open standard java sockets on this LAN.

it uses DHCP // ok

$ more /etc/hosts // <- this is every hosts' "/etc/hosts" !!

....

127.0.0.1localhost.localdomain localhost osl.cs.lxz.edu osl

# [no other entries]

$ hostname // < on every host!!

osl.cs.lxz.edu

$ /sbin/ifconfig

..........

inet addr:10.36.8.50 // < every host has different IP. ok.

$ ping 10.36.8.62 // pinging is ok.

....

64 bytes from 10.36.8.62: icmp_seq=0 ttl=64 time=0.052 ms

....

Socket sok =new Socket(10.36.8.62, 5508);

java.net.ConnectException: Connection refused

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

at java.net.Socket.connect(Socket.java:507)

at java.net.Socket.connect(Socket.java:457)

at java.net.Socket.<init>(Socket.java:365)

at java.net.Socket.<init>(Socket.java:178)

at TechnicalAnalyzer.run(TechnicalAnalyzer.java:62)

at java.lang.Thread.run(Thread.java:595)

TechAnlyz :: run() ..... [exit]

i've tried using:

(_1_) raw byte[] addresses

(_2_) standard InetAddress

(_3_) host name

(_4_) SocketAddress

maybe........ could i use a broadcast and DatagramSockets to

establish a connection?

any ideas?

Message was edited by:

dew2hiroo

Message was edited by:

dew2hiroo

[1846 byte] By [dew2hirooa] at [2007-11-27 0:24:41]
# 1
Is there a server running at port 5508? TCP/IP doesn't think so.
ejpa at 2007-7-11 22:21:48 > top of Java-index,Core,Core APIs...
# 2

> this looks like an impossible problem.

Oh yeah :)

> Socket sok = new Socket(10.36.8.62, 5508);

Why do you know host 10.36.8.62 has opened port number 5508? Who said so?

> maybe........ could i use a broadcast and DatagramSockets to establish a connection?

I don't think so.

Michael.Nazarov@sun.coma at 2007-7-11 22:21:48 > top of Java-index,Core,Core APIs...
# 3
A "horrible socket connection problem" is when you try to make a connection with an electrical socket using a piece of metal wire :)
Herko_ter_Horsta at 2007-7-11 22:21:48 > top of Java-index,Core,Core APIs...
# 4

here is the server code that works at home:

ServerSocket servSok = new ServerSocket(5508);

Socket sok = (Socket) servSok.accept();

......

i just realized the firewalls might have been changed.

i will check. more later.

btw:

is there a way to view accepted ports from non-root shell?

dew2hirooa at 2007-7-11 22:21:48 > top of Java-index,Core,Core APIs...
# 5
"nmap"confirmed this is a firewall issue.note:i am sorry the code snippet did not compile.
dew2hirooa at 2007-7-11 22:21:48 > top of Java-index,Core,Core APIs...
# 6
I dont understand .. you should get a erro due to the lak of coutes in the ip address Socket sok = new Socket(10.36.8.62, 5508); you should write Socket sok = new Socket( "10.36.8.62" , 5508); try this .... there磗 something very strange...
maximilian.brasila at 2007-7-11 22:21:48 > top of Java-index,Core,Core APIs...
# 7
it was just the firewall.connecting is no longer a problem.
dew2hirooa at 2007-7-11 22:21:48 > top of Java-index,Core,Core APIs...