Package py4j
Class NetworkUtil
java.lang.Object
py4j.NetworkUtil
Utility class used to perform network operations.
- Author:
- Barthelemy Dagenais
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
quietlyClose
(Closeable closeable) static void
quietlyClose
(ServerSocket closeable) static void
quietlyClose
(Socket closeable) static void
quietlySetLinger
(Socket socket) Will send a RST packet on close, which should make both remote write and read operations fail.static String
safeReadLine
(BufferedReader reader) static String
safeReadLine
(BufferedReader reader, boolean addSpace)
-
Constructor Details
-
NetworkUtil
public NetworkUtil()
-
-
Method Details
-
safeReadLine
- Parameters:
reader
-addSpace
-- Returns:
- A non-null String with an optional space if it is empty.
- Throws:
IOException
-
safeReadLine
- Parameters:
reader
-- Returns:
- A String of at least one character (space if null or empty).
- Throws:
IOException
-
quietlyClose
-
quietlyClose
-
quietlyClose
-
quietlySetLinger
Will send a RST packet on close, which should make both remote write and read operations fail.
- Parameters:
socket
-
-