tcpBufferSize); channel = socket.getChannel(); port = socket.getLocalPort(); } catch (IOException io) {
/** * pull Sockets from the ServerSocket */ @Override public void run() { if (!isStopped() && !isStopping()) { final ServerSocket serverSocket = this.serverSocket; if (serverSocket == null) { onAcceptError(new IOException("Server started without a valid ServerSocket")); } final ServerSocketChannel channel = serverSocket.getChannel(); if (channel != null) { doRunWithServerSocketChannel(channel); } else { doRunWithServerSocket(serverSocket); } } }
/** * See <code>java.net.ServerSocket</code> javadoc. */ public ServerSocketChannel getChannel() { return ss.getChannel(); }
@Override public ServerSocketChannel getChannel() { return ss.getChannel(); }
/** * {@inheritDoc} * * If {@link #channel} is not {@code null}, returns it. Otherwise, forwards * to {@link #delegate}. */ @Override public ServerSocketChannel getChannel() { ServerSocketChannel channel = this.channel; return (channel == null) ? delegate.getChannel() : channel; }
/** * Initializes a new {@code DelegatingServerSocket} instance which is to * delegate (its method calls) to a specific {@link ServerSocket}. * * @param delegate the {@code ServerSocket} the new instance is to delegate * (it method calls) to * @throws IOException never thrown */ public DelegatingServerSocket(ServerSocket delegate) throws IOException { this(delegate, delegate.getChannel()); }
public ServerSocketChannel getChannel() { return serverSocket.getChannel(); }
public Selector getSelector() { try { ServerSocketChannel channel = _ss.getChannel(); if (channel == null) return null; SelectorProvider provider = channel.provider(); if (provider != null) return provider.openSelector(); else return null; } catch (Throwable e) { log.log(Level.WARNING, e.toString(), e); return null; } }
public Selector getSelector() { try { ServerSocketChannel channel = _ss.getChannel(); if (channel == null) return null; SelectorProvider provider = channel.provider(); if (provider != null) return provider.openSelector(); else return null; } catch (Throwable e) { log.log(Level.WARNING, e.toString(), e); return null; } }
System.out.println("getChannel: " + serverSocket.getChannel()); System.out.println("getInetAddress: " + serverSocket.getInetAddress()); System.out.println("getLocalPort: " + serverSocket.getLocalPort());
@Override public void getInfo(PrintWriter pw) { pw.println("--- Login Manager ---"); pw.println(" Listen Port : " + _listenThread.getListenPort()); pw.println(" Protocol engine: " + _loginCellFactory.getName()); pw.println(" NioChannel : " + (_listenThread._serverSocket.getChannel() != null)); pw.println(" Logins created : " + _loginCounter); pw.println(" Logins failed : " + _loginFailures); pw.println(" Logins denied : " + _connectionDeniedCounter); pw.println(" KeepAlive : " + (_keepAlive.getKeepAlive() / 1000L)); if (_maxLogin > -1) { pw.println(" Logins/max : " + _children.size() + '/' + _maxLogin); } pw.println(); pw.println("--- Login cell factory ---"); _loginCellFactory.getInfo(pw); if (_loginBrokerPublisher != null) { pw.println(); pw.println("--- Login broker info ---"); _loginBrokerPublisher.getInfo(pw); } }
LOGGER.trace("Nio Socket Channel : {}", (_serverSocket.getChannel() != null));
assertTrue(ss1.getChannel() == null);
/** * pull Sockets from the ServerSocket */ @Override public void run() { if (!isStopped() && !isStopping()) { final ServerSocket serverSocket = this.serverSocket; if (serverSocket == null) { onAcceptError(new IOException("Server started without a valid ServerSocket")); } final ServerSocketChannel channel = serverSocket.getChannel(); if (channel != null) { doRunWithServerSocketChannel(channel); } else { doRunWithServerSocket(serverSocket); } } }
/** * pull Sockets from the ServerSocket */ @Override public void run() { if (!isStopped() && !isStopping()) { final ServerSocket serverSocket = this.serverSocket; if (serverSocket == null) { onAcceptError(new IOException("Server started without a valid ServerSocket")); } final ServerSocketChannel channel = serverSocket.getChannel(); if (channel != null) { doRunWithServerSocketChannel(channel); } else { doRunWithServerSocket(serverSocket); } } }
/** * pull Sockets from the ServerSocket */ @Override public void run() { if (!isStopped() && !isStopping()) { final ServerSocket serverSocket = this.serverSocket; if (serverSocket == null) { onAcceptError(new IOException("Server started without a valid ServerSocket")); } final ServerSocketChannel channel = serverSocket.getChannel(); if (channel != null) { doRunWithServerSocketChannel(channel); } else { doRunWithServerSocket(serverSocket); } } }
channel = socket.getChannel();
public void accept( MsgContext ep ) throws IOException { if( sSocket==null ) return; synchronized(this) { while(paused) { try{ wait(); } catch(InterruptedException ie) { //Ignore, since can't happen } } } SocketChannel sc=sSocket.getChannel().accept(); Socket s = sc.socket(); ep.setNote( socketNote, s ); if(log.isDebugEnabled() ) log.debug("Accepted socket " + s +" channel " + sc.isBlocking()); try { setSocketOptions(s); } catch(SocketException sex) { log.debug("Error initializing Socket Options", sex); } requestCount++; sc.configureBlocking(false); InputStream is=new SocketInputStream(sc); OutputStream os = new SocketOutputStream(sc); ep.setNote( isNote, is ); ep.setNote( osNote, os ); ep.setControl( tp ); }
channel = socket.getChannel();
protected void internalInitialize() throws Exception { // Determine the listening port (for the IOR). // This is important when using emphemeral ports (i.e., // when the port value to the constructor is 0). port = serverSocket.getLocalPort(); // Register with transport (also sets up monitoring). orb.getCorbaTransportManager().getInboundConnectionCache(this); // Finish configuation. serverSocketChannel = serverSocket.getChannel(); if (serverSocketChannel != null) { setUseSelectThreadToWait( orb.getORBData().acceptorSocketUseSelectThreadToWait()); serverSocketChannel.configureBlocking( ! orb.getORBData().acceptorSocketUseSelectThreadToWait()); } else { // Configure to use listener and reader threads. setUseSelectThreadToWait(false); } setUseWorkerThreadForEvent( orb.getORBData().acceptorSocketUseWorkerThreadForEvent()); }