001    /**
002     * Copyright (C) 2009-2013 Barchart, Inc. <http://www.barchart.com/>
003     *
004     * All rights reserved. Licensed under the OSI BSD License.
005     *
006     * http://www.opensource.org/licenses/bsd-license.php
007     */
008    package com.barchart.udt.nio;
009    
010    import java.nio.channels.SocketChannel;
011    
012    import com.barchart.udt.ExceptionUDT;
013    import com.barchart.udt.SocketUDT;
014    import com.barchart.udt.TypeUDT;
015    
016    /**
017     * {@link SocketChannel}-like wrapper for {@link SocketUDT}, can be either
018     * stream or message oriented, depending on {@link TypeUDT}
019     * <p>
020     * See <a href="http://udt.sourceforge.net/udt4/doc/t-firewall.htm">Firewall
021     * Traversing with UDT</a>
022     */
023    public class RendezvousChannelUDT extends SocketChannelUDT implements
024                    ChannelUDT {
025    
026            /**
027             * Ensure rendezvous mode.
028             */
029            protected RendezvousChannelUDT( //
030                            final SelectorProviderUDT provider, //
031                            final SocketUDT socketUDT //
032            ) throws ExceptionUDT {
033    
034                    super(provider, socketUDT);
035    
036                    socketUDT.setReuseAddress(true);
037                    socketUDT.setRendezvous(true);
038    
039            }
040    
041            @Override
042            public KindUDT kindUDT() {
043                    return KindUDT.RENDEZVOUS;
044            }
045    
046    }