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

org.xnio.ChannelDestination Maven / Gradle / Ivy

There is a newer version: 3.8.16.Final
Show newest version

package org.xnio;

import java.nio.channels.Channel;
import org.xnio.channels.BoundChannel;

/**
 * A channel destination.  This is the inverse of {@code ChannelSource}; it is used to accept a single connection from a remote
 * peer.
 *
 * @param  the channel type
 *
 * @since 1.2
 */
public interface ChannelDestination {
    /**
     * Accept a connection.  The bind listener will be called when the channel is bound; the open listener will be called
     * when the connection is accepted.  It is not guaranteed that the open listener will be called after the bind listener.
     *
     * @param openListener the listener which will be notified when the channel is open, or {@code null} for none
     * @param bindListener the listener which will be notified when the channel is bound locally, or {@code null} for none
     * @return the future connection
     */
    IoFuture accept(ChannelListener openListener, ChannelListener bindListener);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy