jdk/src/share/classes/java/net/DatagramSocketImpl.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 5506 202f599c92aa
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1996-2006 Sun Microsystems, Inc.  All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.net;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.FileDescriptor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.InterruptedIOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * Abstract datagram and multicast socket implementation base class.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * @author Pavani Diwanji
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * @since  JDK1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
public abstract class DatagramSocketImpl implements SocketOptions {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
     * The local port number.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    protected int localPort;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
     * The file descriptor object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    protected FileDescriptor fd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
     * Creates a datagram socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
     * @exception SocketException if there is an error in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
     * underlying protocol, such as a TCP error.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    protected abstract void create() throws SocketException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * Binds a datagram socket to a local port and address.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * @param lport the local port
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @param laddr the local address
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * @exception SocketException if there is an error in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * underlying protocol, such as a TCP error.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    protected abstract void bind(int lport, InetAddress laddr) throws SocketException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * Sends a datagram packet. The packet contains the data and the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * destination address to send the packet to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * @param p the packet to be sent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * @exception IOException if an I/O exception occurs while sending the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * datagram packet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @exception  PortUnreachableException may be thrown if the socket is connected
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * to a currently unreachable destination. Note, there is no guarantee that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * the exception will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    protected abstract void send(DatagramPacket p) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * Connects a datagram socket to a remote destination. This associates the remote
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * address with the local socket so that datagrams may only be sent to this destination
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * and received from this destination. This may be overridden to call a native
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * system connect.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * <p>If the remote destination to which the socket is connected does not
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * exist, or is otherwise unreachable, and if an ICMP destination unreachable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * packet has been received for that address, then a subsequent call to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * send or receive may throw a PortUnreachableException.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * Note, there is no guarantee that the exception will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * @param address the remote InetAddress to connect to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * @param port the remote port number
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @exception   SocketException may be thrown if the socket cannot be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * connected to the remote destination
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
    protected void connect(InetAddress address, int port) throws SocketException {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * Disconnects a datagram socket from its remote destination.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    protected void disconnect() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * Peek at the packet to see who it is from. Updates the specified <code>InetAddress</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * to the address which the packet came from.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @param i an InetAddress object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @return the port number which the packet came from.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @exception  PortUnreachableException may be thrown if the socket is connected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     *       to a currently unreachable destination. Note, there is no guarantee that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     *       exception will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    protected abstract int peek(InetAddress i) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Peek at the packet to see who it is from. The data is copied into the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * <code>DatagramPacket</code>. The data is returned,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * but not consumed, so that a subsequent peekData/receive operation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     * will see the same data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @param p the Packet Received.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * @return the port number which the packet came from.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * @exception  PortUnreachableException may be thrown if the socket is connected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     *       to a currently unreachable destination. Note, there is no guarantee that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     *       exception will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    protected abstract int peekData(DatagramPacket p) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * Receive the datagram packet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @param p the Packet Received.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * while receiving the datagram packet.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * @exception  PortUnreachableException may be thrown if the socket is connected
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     *       to a currently unreachable destination. Note, there is no guarantee that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *       exception will be thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
    protected abstract void receive(DatagramPacket p) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * Set the TTL (time-to-live) option.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @param ttl a byte specifying the TTL value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * @deprecated use setTimeToLive instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @exception IOException if an I/O exception occurs while setting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * the time-to-live option.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @see #getTTL()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    protected abstract void setTTL(byte ttl) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Retrieve the TTL (time-to-live) option.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * while retrieving the time-to-live option
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @deprecated use getTimeToLive instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @return a byte representing the TTL value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @see #setTTL(byte)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    @Deprecated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    protected abstract byte getTTL() throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     * Set the TTL (time-to-live) option.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @param ttl an <tt>int</tt> specifying the time-to-live value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * while setting the time-to-live option.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @see #getTimeToLive()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
    protected abstract void setTimeToLive(int ttl) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * Retrieve the TTL (time-to-live) option.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * while retrieving the time-to-live option
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * @return an <tt>int</tt> representing the time-to-live value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * @see #setTimeToLive(int)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    protected abstract int getTimeToLive() throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * Join the multicast group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * @param inetaddr multicast address to join.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * while joining the multicast group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    protected abstract void join(InetAddress inetaddr) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * Leave the multicast group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @param inetaddr multicast address to leave.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     * @exception IOException if an I/O exception occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * while leaving the multicast group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    protected abstract void leave(InetAddress inetaddr) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Join the multicast group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * @param mcastaddr address to join.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * @param netIf specifies the local interface to receive multicast
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     *        datagram packets
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @throws IOException if an I/O exception occurs while joining
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * the multicast group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    protected abstract void joinGroup(SocketAddress mcastaddr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                                      NetworkInterface netIf)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * Leave the multicast group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @param mcastaddr address to leave.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @param netIf specified the local interface to leave the group at
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * @throws IOException if an I/O exception occurs while leaving
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * the multicast group
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    protected abstract void leaveGroup(SocketAddress mcastaddr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                                       NetworkInterface netIf)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * Close the socket.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    protected abstract void close();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * Gets the local port.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * @return an <tt>int</tt> representing the local port value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    protected int getLocalPort() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        return localPort;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * Gets the datagram socket file descriptor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @return a <tt>FileDescriptor</tt> object representing the datagram socket
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * file descriptor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    protected FileDescriptor getFileDescriptor() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        return fd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
}