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


Java Selector类代码示例

本文整理汇总了Java中com.sun.corba.se.pept.transport.Selector的典型用法代码示例。如果您正苦于以下问题:Java Selector类的具体用法?Java Selector怎么用?Java Selector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Selector类属于com.sun.corba.se.pept.transport包,在下文中一共展示了Selector类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: closeConnectionResources

import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void closeConnectionResources() {
      if (orb.transportDebugFlag) {
          dprint(".closeConnectionResources->: " + this);
      }
      Selector selector = orb.getTransportManager().getSelector(0);
      selector.unregisterForEvent(this);
      try {
        if (socketChannel != null)
         socketChannel.close() ;
           if (socket != null && !socket.isClosed())
           socket.close() ;
      } catch (IOException e) {
        if (orb.transportDebugFlag) {
            dprint( ".closeConnectionResources: " + this, e ) ;
        }
      }
      if (orb.transportDebugFlag) {
          dprint(".closeConnectionResources<-: " + this);
      }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:SocketOrChannelConnectionImpl.java

示例2: close

import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void close ()
{
    try {
        if (orb.transportDebugFlag) {
            dprint(".close->:");
        }
        Selector selector = orb.getTransportManager().getSelector(0);
        selector.unregisterForEvent(this);
        if (serverSocketChannel != null) {
            serverSocketChannel.close();
        }
        if (serverSocket != null) {
            serverSocket.close();
        }
    } catch (IOException e) {
        if (orb.transportDebugFlag) {
            dprint(".close:", e);
        }
    } finally {
        if (orb.transportDebugFlag) {
            dprint(".close<-:");
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:SocketOrChannelAcceptorImpl.java

示例3: closeConnectionResources

import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void closeConnectionResources() {
      if (orb.transportDebugFlag) {
          dprint(".closeConnectionResources->: " + this);
      }
      Selector selector = orb.getTransportManager().getSelector(0);
      if (selector != null) {
          selector.unregisterForEvent(this);
      }
      try {
        if (socketChannel != null)
         socketChannel.close() ;
           if (socket != null && !socket.isClosed())
           socket.close() ;
      } catch (IOException e) {
        if (orb.transportDebugFlag) {
            dprint( ".closeConnectionResources: " + this, e ) ;
        }
      }
      if (orb.transportDebugFlag) {
          dprint(".closeConnectionResources<-: " + this);
      }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:SocketOrChannelConnectionImpl.java

示例4: close

import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public void close ()
{
    try {
        if (orb.transportDebugFlag) {
            dprint(".close->:");
        }
        Selector selector = orb.getTransportManager().getSelector(0);
        if (selector != null) {
            selector.unregisterForEvent(this);
        }
        if (serverSocketChannel != null) {
            serverSocketChannel.close();
        }
        if (serverSocket != null) {
            serverSocket.close();
        }
    } catch (IOException e) {
        if (orb.transportDebugFlag) {
            dprint(".close:", e);
        }
    } finally {
        if (orb.transportDebugFlag) {
            dprint(".close<-:");
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:SocketOrChannelAcceptorImpl.java

示例5: ReaderThreadImpl

import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public ReaderThreadImpl(ORB orb,
                        Connection connection, Selector selector)
{
    this.orb = orb;
    this.connection = connection;
    this.selector = selector;
    keepRunning = true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:ReaderThreadImpl.java

示例6: ListenerThreadImpl

import com.sun.corba.se.pept.transport.Selector; //导入依赖的package包/类
public ListenerThreadImpl(ORB orb, Acceptor acceptor, Selector selector)
{
    this.orb = orb;
    this.acceptor = acceptor;
    this.selector = selector;
    keepRunning = true;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:ListenerThreadImpl.java


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