1 7 8 package java.net; 9 10 import java.io.FileDescriptor ; 11 import java.io.IOException ; 12 import java.io.InterruptedIOException ; 13 14 19 20 public abstract class DatagramSocketImpl implements SocketOptions { 21 22 25 protected int localPort; 26 27 30 protected FileDescriptor fd; 31 32 37 protected abstract void create() throws SocketException ; 38 39 46 protected abstract void bind(int lport, InetAddress laddr) throws SocketException ; 47 48 58 protected abstract void send(DatagramPacket p) throws IOException ; 59 60 77 protected void connect(InetAddress address, int port) throws SocketException {} 78 79 83 protected void disconnect() {} 84 85 95 protected abstract int peek(InetAddress i) throws IOException ; 96 97 110 protected abstract int peekData(DatagramPacket p) throws IOException ; 111 120 protected abstract void receive(DatagramPacket p) throws IOException ; 121 122 131 @Deprecated 132 protected abstract void setTTL(byte ttl) throws IOException ; 133 134 143 @Deprecated 144 protected abstract byte getTTL() throws IOException ; 145 146 153 protected abstract void setTimeToLive(int ttl) throws IOException ; 154 155 162 protected abstract int getTimeToLive() throws IOException ; 163 164 170 protected abstract void join(InetAddress inetaddr) throws IOException ; 171 172 178 protected abstract void leave(InetAddress inetaddr) throws IOException ; 179 180 189 protected abstract void joinGroup(SocketAddress mcastaddr, 190 NetworkInterface netIf) 191 throws IOException ; 192 193 201 protected abstract void leaveGroup(SocketAddress mcastaddr, 202 NetworkInterface netIf) 203 throws IOException ; 204 205 208 protected abstract void close(); 209 210 214 protected int getLocalPort() { 215 return localPort; 216 } 217 218 223 protected FileDescriptor getFileDescriptor() { 224 return fd; 225 } 226 } 227 | Popular Tags |