com.barchart.udt.nio.RendezvousChannelUDT Maven / Gradle / Ivy
The newest version!
/**
* 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.nio.channels.SocketChannel;
import com.barchart.udt.ExceptionUDT;
import com.barchart.udt.SocketUDT;
import com.barchart.udt.TypeUDT;
/**
* {@link SocketChannel}-like wrapper for {@link SocketUDT}, can be either
* stream or message oriented, depending on {@link TypeUDT}
*
* See Firewall
* Traversing with UDT
*/
public class RendezvousChannelUDT extends SocketChannelUDT implements
ChannelUDT {
/**
* Ensure rendezvous mode.
*/
protected RendezvousChannelUDT( //
final SelectorProviderUDT provider, //
final SocketUDT socketUDT //
) throws ExceptionUDT {
super(provider, socketUDT);
socketUDT.setReuseAddress(true);
socketUDT.setRendezvous(true);
}
@Override
public KindUDT kindUDT() {
return KindUDT.RENDEZVOUS;
}
}