public interface Networking
NioNetworking
that relies on
selectors. But also different implementations can be added like spinning,
thread per connection, epoll, UDP based etc.NioNetworking
Modifier and Type | Method and Description |
---|---|
Channel |
register(EndpointQualifier endpointQualifier,
ChannelInitializerProvider channelInitializerProvider,
SocketChannel socketChannel,
boolean clientMode)
Registers the SocketChannel to the EventLoop group and returns the
created Channel.
|
void |
restart()
Restarts Networking.
|
void |
shutdown()
Shuts down Networking and closes all registered channels.
|
Channel register(EndpointQualifier endpointQualifier, ChannelInitializerProvider channelInitializerProvider, SocketChannel socketChannel, boolean clientMode) throws IOException
Channel.start()
needs to be called.
In the future we need to think about passing the socket channel because
it binds Networking to tcp and this is not desirable.endpointQualifier
- the endpoint qualifier for this server socketchannelInitializerProvider
- the class used for initializing the Channel after creationsocketChannel
- the socketChannel to registerclientMode
- if the channel is made in clientMode or server modeIOException
- when something failed while registering the
socketChannelIllegalStateException
- if Networking isn't running.void restart()
shutdown()
has been completed. This is useful if you
temporarily want to disable networking (e.g. dealing with merging). You should not call this
method when the Networking is still running; first you need to call shutdown()
.IllegalStateException
- if Networking already is running.void shutdown()
Copyright © 2019 Hazelcast, Inc.. All rights reserved.