Package org.nustaq.net
Class TCPObjectSocket
java.lang.Object
org.nustaq.net.TCPObjectSocket
public class TCPObjectSocket extends Object
Created by ruedi on 22.08.14.
As socket allowing to send/receive serializable objects
see ./test/net for an example
Note that by providing a Json configuration, it can be used cross language
-
Field Summary
Fields Modifier and Type Field Description static intBUFFER_SIZE -
Constructor Summary
Constructors Constructor Description TCPObjectSocket(String host, int port)TCPObjectSocket(String host, int port, FSTConfiguration conf)TCPObjectSocket(Socket socket, FSTConfiguration conf) -
Method Summary
Modifier and Type Method Description voidclose()voidflush()FSTConfigurationgetConf()InputStreamgetIn()enables reading raw bytes from socketThrowablegetLastError()SocketgetSocket()booleanisClosed()booleanisStopped()ObjectreadObject()voidsetConf(FSTConfiguration conf)voidsetLastError(Throwable ex)voidwriteObject(Object toWrite)
-
Field Details
-
BUFFER_SIZE
public static int BUFFER_SIZE
-
-
Constructor Details
-
TCPObjectSocket
- Throws:
IOException
-
TCPObjectSocket
- Throws:
IOException
-
TCPObjectSocket
- Throws:
IOException
-
-
Method Details
-
isStopped
public boolean isStopped() -
isClosed
public boolean isClosed() -
getIn
enables reading raw bytes from socket- Returns:
-
readObject
- Throws:
Exception
-
writeObject
- Throws:
Exception
-
flush
- Throws:
IOException
-
setLastError
-
getLastError
-
close
- Throws:
IOException
-
getSocket
-
getConf
-
setConf
-