org.apache.mina.transport.socket.SocketSessionConfig.setAll()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(83)

本文整理了Java中org.apache.mina.transport.socket.SocketSessionConfig.setAll()方法的一些代码示例,展示了SocketSessionConfig.setAll()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SocketSessionConfig.setAll()方法的具体详情如下:
包路径:org.apache.mina.transport.socket.SocketSessionConfig
类名称:SocketSessionConfig
方法名:setAll

SocketSessionConfig.setAll介绍

暂无

代码示例

代码示例来源:origin: kaazing/gateway

public void initSessionConfig() throws RuntimeIoException {
  this.config.setAll(service.getSessionConfig());
}

代码示例来源:origin: org.apache.directory.api/api-all

/**
 * Create the connector
 * 
 * @throws LdapException If the connector can't be created
 */
private void createConnector() throws LdapException
{
  // Use only one thread inside the connector
  connector = new NioSocketConnector( 1 );
  
  if ( connectionConfig != null )
  {
    ( ( SocketSessionConfig ) connector.getSessionConfig() ).setAll( connectionConfig );
  }
  else
  {
    ( ( SocketSessionConfig ) connector.getSessionConfig() ).setReuseAddress( true );
  }
  // Add the codec to the chain
  connector.getFilterChain().addLast( "ldapCodec", ldapProtocolFilter );
  // If we use SSL, we have to add the SslFilter to the chain
  if ( config.isUseSsl() )
  {
    addSslFilter();
  }
  // Inject the protocolHandler
  connector.setHandler( this );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-api

/**
 * Create the connector
 * 
 * @throws LdapException If the connector can't be created
 */
private void createConnector() throws LdapException
{
  // Use only one thread inside the connector
  connector = new NioSocketConnector( 1 );
  
  if ( connectionConfig != null )
  {
    ( ( SocketSessionConfig ) connector.getSessionConfig() ).setAll( connectionConfig );
  }
  else
  {
    ( ( SocketSessionConfig ) connector.getSessionConfig() ).setReuseAddress( true );
  }
  // Add the codec to the chain
  connector.getFilterChain().addLast( "ldapCodec", ldapProtocolFilter );
  // If we use SSL, we have to add the SslFilter to the chain
  if ( config.isUseSsl() )
  {
    addSslFilter();
  }
  // Inject the protocolHandler
  connector.setHandler( this );
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

/**
 * Create the connector
 * 
 * @throws LdapException If the connector can't be created
 */
private void createConnector() throws LdapException
{
  // Use only one thread inside the connector
  connector = new NioSocketConnector( 1 );
  
  if ( connectionConfig != null )
  {
    ( ( SocketSessionConfig ) connector.getSessionConfig() ).setAll( connectionConfig );
  }
  else
  {
    ( ( SocketSessionConfig ) connector.getSessionConfig() ).setReuseAddress( true );
  }
  // Add the codec to the chain
  connector.getFilterChain().addLast( "ldapCodec", ldapProtocolFilter );
  // If we use SSL, we have to add the SslFilter to the chain
  if ( config.isUseSsl() )
  {
    addSslFilter();
  }
  // Inject the protocolHandler
  connector.setHandler( this );
}

代码示例来源:origin: kingston-csj/jforgame

/**
 * start Mina serversocket
 * @throws Exception
 */
public void start(final int serverPort) throws Exception {
  IoBuffer.setUseDirectBuffer(false);
  IoBuffer.setAllocator(new SimpleBufferAllocator());
  acceptor = new NioSocketAcceptor(pool);
  acceptor.setReuseAddress(true);
  acceptor.getSessionConfig().setAll(getSessionConfig());
  logger.info("socket server start at port:{},正在监听客户端的连接...", serverPort);
  DefaultIoFilterChainBuilder filterChain = acceptor.getFilterChain();
  filterChain.addLast("codec",
      new ProtocolCodecFilter(SerializerHelper.getInstance().getCodecFactory()));
  filterChain.addLast("moduleEntrance", new ModuleEntranceFilter());
  filterChain.addLast("msgTrace", new MessageTraceFilter());
  filterChain.addLast("flood", new FloodFilter());
  //指定业务逻辑处理器
  acceptor.setHandler(new ServerSocketIoHandler(new MessageDispatcher()));
  //设置端口号
  acceptor.setDefaultLocalAddress(new InetSocketAddress(serverPort) );
  //启动监听
  acceptor.bind();
}

代码示例来源:origin: org.apache.sshd/sshd-mina

config.setAll(sessionConfig);

相关文章