1 22 package org.xsocket.datagram; 23 24 25 import java.io.Closeable ; 26 import java.io.IOException ; 27 import java.net.InetAddress ; 28 import java.net.SocketAddress ; 29 import java.net.SocketTimeoutException ; 30 import java.util.Map ; 31 32 33 import org.xsocket.ClosedConnectionException; 34 import org.xsocket.IWorkerPool; 35 36 37 38 85 public interface IEndpoint extends Closeable { 86 87 public static final String SO_SNDBUF = "SOL_SOCKET.SO_SNDBUF"; 88 public static final String SO_RCVBUF = "SOL_SOCKET.SO_RCVBUF"; 89 public static final String SO_REUSEADDR = "SOL_SOCKET.SO_REUSEADDR"; 90 public static final String SO_BROADCAST = "SOL_SOCKET.SO_BROADCAST"; 91 public static final String IP_TOS = "IPPROTO_IP.IP_TOS"; 92 public static final String IP_MULTICAST_TTL = "IPPROTO_IP.IP_MULTICAST_TTL"; 93 public static final String IP_MULTICAST_LOOP = "IPPROTO_IP.IP_MULTICAST_LOOP"; 94 95 96 102 public boolean isOpen(); 103 104 105 106 107 108 113 public SocketAddress getLocalSocketAddress(); 114 115 116 121 public InetAddress getLocalAddress(); 122 123 124 129 public int getLocalPort(); 130 131 132 137 public void setDefaultEncoding(String encoding); 138 139 140 145 public String getDefaultEncoding(); 146 147 148 155 public void send(UserDatagram datagram) throws IOException ; 156 157 158 163 public void setReceiveSize(int receiveSize); 164 165 166 170 public int getReceiveSize(); 171 172 173 179 public UserDatagram receive() throws IOException ; 180 181 182 183 191 public UserDatagram receive(long timeoutMillis) throws IOException , SocketTimeoutException ; 192 193 194 195 198 public void setWorkerPool(IWorkerPool workerPool); 199 200 201 202 206 public String getId(); 207 208 209 210 217 public Object getOption(String name) throws IOException ; 218 219 220 221 229 public Map <String ,Class > getOptions(); 230 } 231 | Popular Tags |