Package com.github.kokorin.jaffree.net
Class NegotiatingTcpServer
java.lang.Object
com.github.kokorin.jaffree.net.TcpServer
com.github.kokorin.jaffree.net.NegotiatingTcpServer
- All Implemented Interfaces:
ProcessHelper,Closeable,AutoCloseable,Runnable
TcpServer implementation using TcpNegotiator to serve TCP connection.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNegotiatingTcpServer(ServerSocket serverSocket, TcpNegotiator negotiator) -
Method Summary
Modifier and TypeMethodDescriptionstatic NegotiatingTcpServeronRandomPort(TcpNegotiator negotiator) CreatesNegotiatingTcpServerwaiting for TCP connection on random port.protected voidServes TCP connection usingTcpNegotiator.Methods inherited from class com.github.kokorin.jaffree.net.TcpServer
allocateSocket, close, finalize, getAddressAndPort, run, toString
-
Constructor Details
-
NegotiatingTcpServer
-
-
Method Details
-
serve
Serves TCP connection usingTcpNegotiator.- Specified by:
servein classTcpServer- Parameters:
socket- TCP socket- Throws:
IOException- socket IO exception
-
onRandomPort
CreatesNegotiatingTcpServerwaiting for TCP connection on random port.- Parameters:
negotiator- negotiator to use- Returns:
- NegotiatingTcpServer
-