/[classpath]/classpath/java/net/DatagramSocket.java
ViewVC logotype

Diff of /classpath/java/net/DatagramSocket.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by mkoch, Fri Sep 19 06:12:39 2003 UTC revision 1.29 by mkoch, Fri Sep 19 07:07:40 2003 UTC
# Line 35  this exception to your version of the li Line 35  this exception to your version of the li
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;
# Line 74  public class DatagramSocket Line 75  public class DatagramSocket
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;
# Line 256  public class DatagramSocket Line 251  public class DatagramSocket
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
# Line 506  public class DatagramSocket Line 501  public class DatagramSocket
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);
# Line 555  public class DatagramSocket Line 551  public class DatagramSocket
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);
# Line 605  public class DatagramSocket Line 602  public class DatagramSocket
602     */     */
603    public DatagramChannel getChannel()    public DatagramChannel getChannel()
604    {    {
605      return ch;      return null;
606    }    }
607    
608    /**    /**

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26