All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.barchart.udt.nio.NioServerSocketUDT Maven / Gradle / Ivy

/**
 * Copyright (C) 2009-2013 Barchart, Inc. 
 *
 * All rights reserved. Licensed under the OSI BSD License.
 *
 * http://www.opensource.org/licenses/bsd-license.php
 */
package com.barchart.udt.nio;

import java.io.IOException;
import java.net.Socket;
import java.net.SocketAddress;

import com.barchart.udt.net.NetServerSocketUDT;

public class NioServerSocketUDT extends NetServerSocketUDT {

	protected final ServerSocketChannelUDT channelUDT;

	protected NioServerSocketUDT(final ServerSocketChannelUDT channelUDT)
			throws IOException {
		super(channelUDT.socketUDT());
		this.channelUDT = channelUDT;
	}

	@Override
	public Socket accept() throws IOException {
		throw new RuntimeException("feature not available");
	}

	@Override
	public void bind(final SocketAddress endpoint) throws IOException {
		final SelectorProviderUDT provider = //
		(SelectorProviderUDT) channelUDT.provider();
		final int backlog = provider.getAcceptQueueSize();
		bind(endpoint, backlog);
	}

	@Override
	public ServerSocketChannelUDT getChannel() {
		return channelUDT;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy