由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - A Simple Java Socket Issue
相关主题
Socket Connection refused in high-loaded serversEclipse的Javadoc信息显示问题
请问一下菜鸟问问题?
socket programing server-server怎么通讯?how to transfer data between two sockets
新手问题Re: JDE1.2.2 Standard version下如何找classpath的?
笨问题续:TOMCATxp 是不是不支持jave 阿?
JRE的DNS怪现象JRE 1.4 和 1.3的主要区别是什么
有人在 Win7 上用 Tomcat 吗?help!!
send() vs sendto()ant javac error in eclipse 3.0?
相关话题的讨论汇总
话题: socket话题: ip话题: 80话题: port话题: java
进入Java版参与讨论
1 (共1页)
b******e
发帖数: 671
1
I try to create a server socket on port 80 using
ServerSocket s = new ServerSocket(80);
But it always open the TCP port 80 on IP 0.0.0.0.
What I want is to open the port 80 on my local IP, such as
192.168.0.100.
By the way, I use comcast for internet. The IPCONFIG of my machine looks
like
Ethernet adapter local area connection:
Connection DNS Suffix : hsd1..comcast..
IP address : 192.168.0.100
Subnet Mask : 255...
Default Gateway : 192...
Ethernet adapter {1BXXXX-4
s******n
发帖数: 876
2
give the constructor the explicit IP address.
this may work:
new ServerSocket(80,50, InetAddress.getLocalHost());
b******e
发帖数: 671
3
Thanks a lot. It helps.
Now, I can see from NETSTAT that the port 80 of IP 192.168.0.100 is
Listening.
When I try to open a client socket to connect with server, such as
Socket sock = new Socket("192.168.0.100", 80);
It throws a "connection refuse" exception. Any suggestion?
By the way, I turned off the XP firewall.
q*********u
发帖数: 280
4
你这个是80端口,估计有apache或者iis的service开在那里,关掉
当然没有强行要求,最好不要用80

【在 b******e 的大作中提到】
: Thanks a lot. It helps.
: Now, I can see from NETSTAT that the port 80 of IP 192.168.0.100 is
: Listening.
: When I try to open a client socket to connect with server, such as
: Socket sock = new Socket("192.168.0.100", 80);
: It throws a "connection refuse" exception. Any suggestion?
: By the way, I turned off the XP firewall.

b******e
发帖数: 671
5
没装APACHE/IIS.
其它的端口也试过(8080,12345,...), 也不行.
不知道是不是JAVA SDK, JAVA JRE版本不同之类的问题.
m******t
发帖数: 2416
6
First run "netstat -ltnp" to make sure it is your process that's listening
on the port.
Then run "telnet 192.168.0.100 80" from command line to try the connection.

【在 b******e 的大作中提到】
: Thanks a lot. It helps.
: Now, I can see from NETSTAT that the port 80 of IP 192.168.0.100 is
: Listening.
: When I try to open a client socket to connect with server, such as
: Socket sock = new Socket("192.168.0.100", 80);
: It throws a "connection refuse" exception. Any suggestion?
: By the way, I turned off the XP firewall.

1 (共1页)
进入Java版参与讨论
相关主题
ant javac error in eclipse 3.0?笨问题续:TOMCAT
Java virtual machineJRE的DNS怪现象
a wired problem about JRE for IE,Thanks有人在 Win7 上用 Tomcat 吗?
大家做JSP/Java开发的配置是怎样的?send() vs sendto()
Socket Connection refused in high-loaded serversEclipse的Javadoc信息显示问题
请问一下菜鸟问问题?
socket programing server-server怎么通讯?how to transfer data between two sockets
新手问题Re: JDE1.2.2 Standard version下如何找classpath的?
相关话题的讨论汇总
话题: socket话题: ip话题: 80话题: port话题: java