Java.net.Socket
Java 소켓(Socket)통신과 관련된 정리.
How to terminate a thread blocking on socket IO operation instantly
There are two ways to do this:
- Calling Thread.interrupt() will (under some circumstances that are not specified) interrupt a blocking I/O operation, causing it to throw an InterruptedIOException or ClosedByInterruptException.
- Calling Socket.close() on the socket will close the associated InputStream and OutputStream objects, and cause any threads blocked in Socket or (associated) stream operations to be unblocked. According to the javadoc, operations on the socket itself will throw a SocketException.
See also
Favorite site
- Java 소켓통신예제 1
- [추천] Stackoverflow: How to have multiple clients connect to a server java: Plain Thread Example
- Java Sockets Example 2
- 클래스 java.net.Socket (한글) 3
- JAVA 소켓 연결에 대한 Timeout 4
- 클래스 java.net.Socket (한글) 5
- Stream과 Socket 6
References
-
Java_socket_programming_example.pdf ↩
-
Zerioh_tripod_com-Java_Sockets_Example.zip ↩
-
Www.javacool.net.zip (
www.javacool.net/_cool/api_doc/kor_jdk11api/java.net.Socket_dsc.htm
참조) ↩ -
Java_socket_timeout.pdf ↩
-
Xrath_com-java-spec.zip (
xrath.com/javase/ko/6/docs/ko/api/java/net/Socket.html
참조) ↩ -
Java_stream_and_socket.pdf ↩