@Override protected void accept(SocketImpl socket) throws IOException { final AFUNIXSocketImpl si = (AFUNIXSocketImpl) socket; NativeUnixSocket.accept(socketFile, fd, si.fd); si.socketFile = socketFile; si.connected = true; }
@Override public void run() throws SocketException { inner.setSoLinger(on, linger); } });
@Override public void run() throws SocketException { inner.setSoTimeout(timeout); } });
@Override public int read() throws IOException { final byte[] buf1 = new byte[1]; final int numRead = read(buf1, 0, 1); if (numRead <= 0) { return -1; } else { return buf1[0] & 0xFF; } }
@Override public int available() throws IOException { final int av = NativeUnixSocket.available(fd); return av; } }
@Override public void write(int oneByte) throws IOException { final byte[] buf1 = new byte[] {(byte) oneByte}; write(buf1, 0, 1); }
@Override public boolean isConnected() { return inner.isConnected(); }
@Override public void run() throws SocketException { inner.setTcpNoDelay(on); } });
@Override public void run() throws SocketException { inner.setSendBufferSize(size); } });
@Override public void run() throws SocketException { inner.setTrafficClass(tc); } });
private static int expectInteger(Object value) throws SocketException { try { return (Integer) value; } catch (final ClassCastException e) { throw new AFUNIXSocketException("Unsupported value: " + value, e); } catch (final NullPointerException e) { throw new AFUNIXSocketException("Value must not be null", e); } }
@Override public void run() throws SocketException { inner.setOOBInline(on); } });
@Override public void run() throws SocketException { inner.setReceiveBufferSize(size); } });
@Override public void run() throws SocketException { inner.setKeepAlive(on); } });
@Override public int getLocalPort() { return inner.getLocalPort(); }
@Override public boolean getOOBInline() throws SocketException { return inner.getOOBInline(); }
@Override public synchronized int getSoTimeout() throws SocketException { return inner.getSoTimeout(); }
@Override public int getTrafficClass() throws SocketException { return inner.getTrafficClass(); }
@Override public SocketAddress getRemoteSocketAddress() { return inner.getRemoteSocketAddress(); }
@Override public boolean isOutputShutdown() { return inner.isOutputShutdown(); }