@Override public boolean isInputShutdown() { if (_socket instanceof SSLSocket) return super.isInputShutdown(); return _socket.isClosed() || _socket.isInputShutdown(); }
public final boolean isClosed() { return !isOpen(); }
@Override public boolean isOutputShutdown() { if (_socket instanceof SSLSocket) return super.isOutputShutdown(); return _socket.isClosed() || _socket.isOutputShutdown(); }
public int fill(Buffer buffer) throws IOException { if (_ishut) return -1; if (_in==null) return 0; int space=buffer.space(); if (space<=0) { if (buffer.hasContent()) return 0; throw new IOException("FULL"); } try { int filled=buffer.readFrom(_in, space); if (filled<0) shutdownInput(); return filled; } catch(SocketTimeoutException e) { idleExpired(); return -1; } }
/** * */ public SocketEndPoint(Socket socket) throws IOException { super(socket.getInputStream(),socket.getOutputStream()); _socket=socket; _local=(InetSocketAddress)_socket.getLocalSocketAddress(); _remote=(InetSocketAddress)_socket.getRemoteSocketAddress(); super.setMaxIdleTime(_socket.getSoTimeout()); }
public int available() throws IOException { if (_contentView!=null && _contentView.length()>0) return _contentView.length(); if (_endp.isBlocking()) { if (_state>0 && _endp instanceof StreamEndPoint) return ((StreamEndPoint)_endp).getInputStream().available()>0?1:0; return 0; } parseNext(); return _contentView==null?0:_contentView.length(); }
@Override public void shutdownInput() throws IOException { if (_socket instanceof SSLSocket) super.shutdownInput(); else shutdownSocketInput(); }
@Override public void shutdownOutput() throws IOException { if (_socket instanceof SSLSocket) super.shutdownOutput(); else shutdownSocketOutput(); }
public int fill(Buffer buffer) throws IOException { if (_ishut) return -1; if (_in==null) return 0; int space=buffer.space(); if (space<=0) { if (buffer.hasContent()) return 0; throw new IOException("FULL"); } try { int filled=buffer.readFrom(_in, space); if (filled<0) shutdownInput(); return filled; } catch(SocketTimeoutException e) { idleExpired(); return -1; } }
/** * */ public SocketEndPoint(Socket socket) throws IOException { super(socket.getInputStream(),socket.getOutputStream()); _socket=socket; _local=(InetSocketAddress)_socket.getLocalSocketAddress(); _remote=(InetSocketAddress)_socket.getRemoteSocketAddress(); super.setMaxIdleTime(_socket.getSoTimeout()); }
public int available() throws IOException { if (_contentView!=null && _contentView.length()>0) return _contentView.length(); if (_endp.isBlocking()) { if (_state>0 && _endp instanceof StreamEndPoint) return ((StreamEndPoint)_endp).getInputStream().available()>0?1:0; return 0; } parseNext(); return _contentView==null?0:_contentView.length(); }
@Override public void shutdownInput() throws IOException { if (_socket instanceof SSLSocket) super.shutdownInput(); else shutdownSocketInput(); }
@Override public void shutdownOutput() throws IOException { if (_socket instanceof SSLSocket) super.shutdownOutput(); else shutdownSocketOutput(); }
public int fill(Buffer buffer) throws IOException { if (_ishut) return -1; if (_in==null) return 0; int space=buffer.space(); if (space<=0) { if (buffer.hasContent()) return 0; throw new IOException("FULL"); } try { int filled=buffer.readFrom(_in, space); if (filled<0) shutdownInput(); return filled; } catch(SocketTimeoutException e) { idleExpired(); return -1; } }
/** * */ protected SocketEndPoint(Socket socket, int maxIdleTime) throws IOException { super(socket.getInputStream(),socket.getOutputStream()); _socket=socket; _local=(InetSocketAddress)_socket.getLocalSocketAddress(); _remote=(InetSocketAddress)_socket.getRemoteSocketAddress(); _socket.setSoTimeout(maxIdleTime>0?maxIdleTime:0); super.setMaxIdleTime(maxIdleTime); }
public final boolean isClosed() { return !isOpen(); }
public int available() throws IOException { if (_contentView!=null && _contentView.length()>0) return _contentView.length(); if (_endp.isBlocking()) { if (_state>0 && _endp instanceof StreamEndPoint) return ((StreamEndPoint)_endp).getInputStream().available()>0?1:0; return 0; } parseNext(); return _contentView==null?0:_contentView.length(); }
@Override public void shutdownInput() throws IOException { if (_socket instanceof SSLSocket) super.shutdownInput(); else shutdownSocketInput(); }