1 22 package org.xsocket.stream.io.spi; 23 24 import java.io.IOException ; 25 import java.net.InetAddress ; 26 import java.nio.ByteBuffer ; 27 import java.util.LinkedList ; 28 import java.util.Map ; 29 30 import org.xsocket.ClosedConnectionException; 31 32 33 34 51 public interface IIoHandler { 52 53 54 60 public void init(IIoHandlerCallback callbackHandler) throws IOException ; 61 62 63 64 69 public InetAddress getLocalAddress(); 70 71 72 77 public int getLocalPort(); 78 79 80 81 86 public InetAddress getRemoteAddress(); 87 88 89 94 public int getRemotePort(); 95 96 97 98 103 public void setIdleTimeoutSec(int timeout); 104 105 106 107 111 public String getId(); 112 113 118 public void setConnectionTimeoutSec(int timeout); 119 120 121 126 public int getConnectionTimeoutSec(); 127 128 129 134 public int getIdleTimeoutSec(); 135 136 137 144 public Object getOption(String name) throws IOException ; 145 146 147 148 156 public Map <String ,Class > getOptions(); 157 158 159 160 167 public void setOption(String name, Object value) throws IOException ; 168 169 170 175 public boolean isOpen(); 176 177 178 188 public void close(boolean immediate) throws IOException ; 189 190 191 200 public void writeOutgoing(ByteBuffer buffer) throws ClosedConnectionException, IOException ; 201 202 203 204 213 public void writeOutgoing(LinkedList <ByteBuffer > buffers) throws ClosedConnectionException, IOException ; 214 215 216 217 223 public int getPendingWriteDataSize(); 224 225 226 227 232 public void suspendRead() throws IOException ; 233 234 235 240 public void resumeRead() throws IOException ; 241 242 257 public LinkedList <ByteBuffer > drainIncoming(); 258 } 259 | Popular Tags |