Object
MessageServer
- All Implemented Interfaces:
AutoCloseable
,Runnable
Runs ICE server on a given port and manages all interaction between clients and
MessageService
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Calling close on server which is not started has no effectvoid
run()
Starts ICE server.withNumberOfThreads
(int threads) withPort
(int port) Port where to run the server.
-
Constructor Details
-
MessageServer
- Parameters:
service
- message service implementation which will process all incoming messagesscanner
- scanner for messages to use
-
-
Method Details
-
withPort
Port where to run the server.- See Also:
-
withNumberOfThreads
-
run
public void run()Starts ICE server.It opens a given port and starts to accept connections. For each new incoming connection it will run a looper.
-
close
Calling close on server which is not started has no effect- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-