35 |
obligated to do so. If you do not wish to do so, delete this |
obligated to do so. If you do not wish to do so, delete this |
36 |
exception statement from your version. */ |
exception statement from your version. */ |
37 |
|
|
38 |
|
|
39 |
package java.net; |
package java.net; |
40 |
|
|
41 |
import gnu.java.net.PlainDatagramSocketImpl; |
import gnu.java.net.PlainDatagramSocketImpl; |
75 |
DatagramSocketImpl impl; |
DatagramSocketImpl impl; |
76 |
|
|
77 |
/** |
/** |
|
* The unique DatagramChannel object associated with this datagram socket, |
|
|
* or null. |
|
|
*/ |
|
|
DatagramChannel ch; |
|
|
|
|
|
/** |
|
78 |
* This is the address we are "connected" to |
* This is the address we are "connected" to |
79 |
*/ |
*/ |
80 |
private InetAddress remoteAddress; |
private InetAddress remoteAddress; |
251 |
{ |
{ |
252 |
if (impl == null) |
if (impl == null) |
253 |
return null; |
return null; |
254 |
|
|
255 |
// FIXME: According to libgcj, checkConnect() is supposed to be called |
// FIXME: According to libgcj, checkConnect() is supposed to be called |
256 |
// before performing this operation. Problems: 1) We don't have the |
// before performing this operation. Problems: 1) We don't have the |
257 |
// addr until after we do it, so we do a post check. 2). The docs I |
// addr until after we do it, so we do a post check. 2). The docs I |
501 |
throw new IOException ( |
throw new IOException ( |
502 |
"Socket connected to a multicast address my not receive"); |
"Socket connected to a multicast address my not receive"); |
503 |
|
|
504 |
if (ch != null && !ch.isBlocking ()) |
if (getChannel() != null |
505 |
|
&& !getChannel().isBlocking ()) |
506 |
throw new IllegalBlockingModeException (); |
throw new IllegalBlockingModeException (); |
507 |
|
|
508 |
impl.receive(p); |
impl.receive(p); |
551 |
// FIXME: if this is a subclass of MulticastSocket, |
// FIXME: if this is a subclass of MulticastSocket, |
552 |
// use getTimeToLive for TTL val. |
// use getTimeToLive for TTL val. |
553 |
|
|
554 |
if (ch != null && !ch.isBlocking ()) |
if (getChannel() != null |
555 |
|
&& !getChannel().isBlocking ()) |
556 |
throw new IllegalBlockingModeException (); |
throw new IllegalBlockingModeException (); |
557 |
|
|
558 |
impl.send(p); |
impl.send(p); |
602 |
*/ |
*/ |
603 |
public DatagramChannel getChannel() |
public DatagramChannel getChannel() |
604 |
{ |
{ |
605 |
return ch; |
return null; |
606 |
} |
} |
607 |
|
|
608 |
/** |
/** |