当前位置: 首页>>代码示例>>Java>>正文


Java SctpServerChannel.open方法代码示例

本文整理汇总了Java中com.sun.nio.sctp.SctpServerChannel.open方法的典型用法代码示例。如果您正苦于以下问题:Java SctpServerChannel.open方法的具体用法?Java SctpServerChannel.open怎么用?Java SctpServerChannel.open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.nio.sctp.SctpServerChannel的用法示例。


在下文中一共展示了SctpServerChannel.open方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import com.sun.nio.sctp.SctpServerChannel; //导入方法依赖的package包/类
@Override
public void start() throws IOException {

	this.sctpServerChannel = SctpServerChannel.open();		
	sctpServerChannel.bind( new InetSocketAddress(this.getIpAddress(),this.getPort()) );
	sctpServerChannel.configureBlocking( false );
	
	this.selector = Selector.open();
	this.key = sctpServerChannel.register( selector, SelectionKey.OP_ACCEPT );
			
	// Start a daemon thread to handle reception
	this.isRunning = true;
       Thread thread = new Thread(this);
       thread.setDaemon(true);
       thread.setName("SCTPMessageProcessorThread");
       thread.setPriority(Thread.MAX_PRIORITY);
       thread.start();
}
 
开发者ID:YunlongYang,项目名称:LightSIP,代码行数:19,代码来源:SCTPMessageProcessor.java

示例2: connectChannel

import com.sun.nio.sctp.SctpServerChannel; //导入方法依赖的package包/类
SctpChannel connectChannel(SctpChannel channel)
    throws IOException {
    debug("connecting channel...");
    try {
        SctpServerChannel ssc = SctpServerChannel.open();
        ssc.bind(null);
        Set<SocketAddress> addrs = ssc.getAllLocalAddresses();
        Iterator<SocketAddress> iterator = addrs.iterator();
        SocketAddress addr = iterator.next();
        debug("using " + addr + "...");
        channel.connect(addr);
        SctpChannel peerChannel = ssc.accept();
        ssc.close();
        debug("connected");
        return peerChannel;
    } catch (IOException ioe) {
        debug("Cannot connect channel");
        unexpected(ioe);
        throw ioe;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:22,代码来源:Bind.java

示例3: newServerSocket

import com.sun.nio.sctp.SctpServerChannel; //导入方法依赖的package包/类
private static SctpServerChannel newServerSocket() {
    try {
        return SctpServerChannel.open();
    } catch (IOException e) {
        throw new ChannelException("failed to create a sctp server channel", e);
    }
}
 
开发者ID:wuyinxian124,项目名称:netty4.0.27Learn,代码行数:8,代码来源:OioSctpServerChannel.java

示例4: newSocket

import com.sun.nio.sctp.SctpServerChannel; //导入方法依赖的package包/类
private static SctpServerChannel newSocket() {
    try {
        return SctpServerChannel.open();
    } catch (IOException e) {
        throw new ChannelException(
                "Failed to open a server socket.", e);
    }
}
 
开发者ID:wuyinxian124,项目名称:netty4.0.27Learn,代码行数:9,代码来源:NioSctpServerChannel.java


注:本文中的com.sun.nio.sctp.SctpServerChannel.open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。