problem 2 « Socket « Java Network Q&A

Home
Java Network Q&A
1.API
2.bluetooth
3.Client
4.connection
5.Cookie
6.Development
7.Email
8.File
9.ftp
10.http
11.HttpClient
12.https
13.ip
14.Network
15.OS
16.RMI
17.Security
18.Server
19.Socket
20.tcp
21.UDP
22.url
Java Network Q&A » Socket » problem 2 

1. problem with sockets    forums.oracle.com

this is the error being occured, after in the command prompt (Start > Run > cmd).. Java Client Hello World Status:Connected Hello World Exception in thread "main" java.net.SocketException: Connection rese t at java.net.SocketInputStream.read(SocketInputStream.java:168) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.fill(BufferedReader.java:136) at java.io.BufferedReader.readLine(BufferedReader.java:299) at java.io.BufferedReader.readLine(BufferedReader.java:362) at Server.main(Server.java:20) Press any key to continue . . . anybody can help me ...

2. Problem with Sockets :: java.net.ConnectException    forums.oracle.com

That's not a cross-post, that's a post on a different website. Your statement there that new ServerSocket(...) citing the bind-address can only be used where the host has more than one IP address is not correct. The bind-address does have be one of the N local IP addresses but it works for N=1 as well as N > 1.

3. Socket problem    forums.oracle.com

Thank you Kaj. I did the same thing and put accept() in a while loop. Unfortranetly, once the client was closed, it can not reconnect to the server any more. This is the pseudo code of my question. Server Side: SOCKET Socket; Socket = socket(AF_INET, SOCK_STREAM, 0); SOCKADDR_IN SockAddr; assign IP and port to SockAddr; bind the socket; listen(Socket, 1); SOCKET ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.