简体   繁体   English

IO异常客户端/服务器套接字

[英]IO exception client/server socket

I am writing a client/server program to send data over my own local internet wireless network. 我正在编写一个客户端/服务器程序,以通过自己的本地Internet无线网络发送数据。 In the client side, I wrote this snippet 在客户端,我写了这段代码

private static final int TCP_SERVER_PORT = 63400
    try {
        // provide a client side TCP socket

        Socket s = new Socket("192.168.1.102", TCP_SERVER_PORT);
            ...

It throws an IOException. 它引发IOException。 I add the INTERNET permission though. 我虽然添加了INTERNET权限。 I am joining the local DSL internet wifi network. 我正在加入本地DSL互联网wifi网络。 Is it because of the router? 是因为路由器吗? Any idea? 任何想法?

Is port 63400 on 192.168.1.102 open? 192.168.1.102上的端口63400是否打开?

try 尝试

telnet 192.168.1.102 63400

if it returns anything then the port is open, and the problem is somewhere else. 如果返回任何内容,则说明端口已打开,问题出在其他地方。 If it says "name or service unknown" then there is no one listening @ 192.168.1.102:63400 如果显示“名称或服务未知”,则表明没有人正在监听192.168.1.102:63400

EDIT: just noticed the android tag. 编辑:刚注意到android标签。 Don't know if u have shell/telnet on android, but you can use this method from PC both windows and linux shell 不知道您在Android上是否具有shell / telnet,但是您可以在PC的Windows和Linux Shell上使用此方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java socket io客户端无法连接到socket io nodejs服务器 - Java socket io client fail to connect to socket io nodejs server socket.io-client java没有连接到服务器 - socket.io-client java not connecting to server Android 工作室:Socket.io 服务器和客户端 - Android studio: Socket.io server and client Android developpement,Gottox socket.io-java-client:file not fount Exception /socket.io/1/ - Android developpement, Gottox socket.io-java-client: file not fount Exception /socket.io/1/ socket.io客户端与socket.io服务器0.9.6的连接问题 - Connection problems with the socket.io-client to socket.io server 0.9.6 最新的Openshift更新后Socket.IO客户端无法连接到Socket.IO nodejs服务器 - Socket.IO Client fail to connect to Socket.IO nodejs server after latest Openshift update socket.io客户端连接到服务器,但无法通信 - socket.io client connects to the server but does not communicate 服务器和客户端之间的同步计时器-Node js / android / socket io - Sync timer between server and client - node js / android / socket io 我无法使用Socket.IO-client Java连接到服务器 - I can not connect to server with Socket.IO-client Java Google Cloud socket.io 服务器,客户端未保持持久连接 - Google Cloud socket.io server, client not keeping persistent connection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM