Search in sources :

Example 1 with Networking

use of com.hazelcast.internal.networking.Networking in project hazelcast by hazelcast.

the class DefaultNodeContext method createServer.

@Override
public Server createServer(Node node, ServerSocketRegistry registry, LocalAddressRegistry addressRegistry) {
    TcpServerContext context = new TcpServerContext(node, node.nodeEngine);
    Networking networking = createNetworking(node);
    Config config = node.getConfig();
    MetricsRegistry metricsRegistry = node.nodeEngine.getMetricsRegistry();
    return new TcpServer(config, context, registry, addressRegistry, metricsRegistry, networking, node.getNodeExtension().createChannelInitializerFn(context));
}
Also used : MetricsRegistry(com.hazelcast.internal.metrics.MetricsRegistry) Networking(com.hazelcast.internal.networking.Networking) NioNetworking(com.hazelcast.internal.networking.nio.NioNetworking) Config(com.hazelcast.config.Config) ConfigAccessor.getActiveMemberNetworkConfig(com.hazelcast.config.ConfigAccessor.getActiveMemberNetworkConfig) MemberAddressProviderConfig(com.hazelcast.config.MemberAddressProviderConfig) TcpServerContext(com.hazelcast.internal.server.tcp.TcpServerContext) TcpServer(com.hazelcast.internal.server.tcp.TcpServer)

Example 2 with Networking

use of com.hazelcast.internal.networking.Networking in project hazelcast by hazelcast.

the class TcpServerConnectionManager method newChannel.

Channel newChannel(SocketChannel socketChannel, boolean clientMode) throws IOException {
    Networking networking = server.getNetworking();
    ChannelInitializer channelInitializer = channelInitializerFn.apply(endpointQualifier);
    assert channelInitializer != null : "Found NULL channel initializer for endpoint-qualifier " + endpointQualifier;
    Channel channel = networking.register(channelInitializer, socketChannel, clientMode);
    // Advanced Network
    if (endpointConfig != null) {
        setChannelOptions(channel, endpointConfig);
    }
    acceptedChannels.add(channel);
    return channel;
}
Also used : Networking(com.hazelcast.internal.networking.Networking) SocketChannel(java.nio.channels.SocketChannel) Channel(com.hazelcast.internal.networking.Channel) ChannelInitializer(com.hazelcast.internal.networking.ChannelInitializer)

Aggregations

Networking (com.hazelcast.internal.networking.Networking)2 Config (com.hazelcast.config.Config)1 ConfigAccessor.getActiveMemberNetworkConfig (com.hazelcast.config.ConfigAccessor.getActiveMemberNetworkConfig)1 MemberAddressProviderConfig (com.hazelcast.config.MemberAddressProviderConfig)1 MetricsRegistry (com.hazelcast.internal.metrics.MetricsRegistry)1 Channel (com.hazelcast.internal.networking.Channel)1 ChannelInitializer (com.hazelcast.internal.networking.ChannelInitializer)1 NioNetworking (com.hazelcast.internal.networking.nio.NioNetworking)1 TcpServer (com.hazelcast.internal.server.tcp.TcpServer)1 TcpServerContext (com.hazelcast.internal.server.tcp.TcpServerContext)1 SocketChannel (java.nio.channels.SocketChannel)1