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

Diff of /classpath/java/net/PlainSocketImpl.java

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

revision 1.12 by mkoch, Sat Jun 21 14:07:07 2003 UTC revision 1.13 by mkoch, Mon Jun 23 12:49:44 2003 UTC
# Line 63  class PlainSocketImpl extends SocketImpl Line 63  class PlainSocketImpl extends SocketImpl
63  {  {
64    // Static initializer to load native library.    // Static initializer to load native library.
65    static    static
66    {      {
67      if (Configuration.INIT_LOAD_LIBRARY)        if (Configuration.INIT_LOAD_LIBRARY)
68        {          {
69          System.loadLibrary("javanet");            System.loadLibrary("javanet");
70        }          }
71    }      }
72    
73    /**    /**
74     * The OS file handle representing the socket.     * The OS file handle representing the socket.
# Line 80  class PlainSocketImpl extends SocketImpl Line 80  class PlainSocketImpl extends SocketImpl
80    protected int native_fd = -1;    protected int native_fd = -1;
81    
82    /**    /**
83       * A cached copy of the in stream for reading from the socket.
84       */
85      private InputStream in;
86    
87      /**
88       * A cached copy of the out stream for writing to the socket.
89       */
90      private OutputStream out;
91    
92      /**
93     * Default do nothing constructor     * Default do nothing constructor
94     */     */
95    public PlainSocketImpl()    public PlainSocketImpl()
# Line 97  class PlainSocketImpl extends SocketImpl Line 107  class PlainSocketImpl extends SocketImpl
107     *     *
108     * @exception SocketException If an error occurs     * @exception SocketException If an error occurs
109     */     */
110    public native void setOption(int option_id, Object val)    public native void setOption(int optID, Object value) throws SocketException;
     throws SocketException;  
111    
112    /**    /**
113     * Returns the current setting of the specified option.  The Object returned     * Returns the current setting of the specified option.  The Object returned
# Line 111  class PlainSocketImpl extends SocketImpl Line 120  class PlainSocketImpl extends SocketImpl
120     *     *
121     * @exception SocketException If an error occurs     * @exception SocketException If an error occurs
122     */     */
123    public native Object getOption(int option_id)    public native Object getOption(int optID) throws SocketException;
     throws SocketException;  
124    
125    public void shutdownInput()    public void shutdownInput()
126    {    {
# Line 143  class PlainSocketImpl extends SocketImpl Line 151  class PlainSocketImpl extends SocketImpl
151     *     *
152     * @exception IOException If an error occurs     * @exception IOException If an error occurs
153     */     */
154    protected synchronized void connect(String hostname, int port)    protected synchronized void connect (String host, int port) throws IOException
     throws IOException  
155    {    {
156      InetAddress addr = InetAddress.getByName(hostname);      connect (InetAddress.getByName (host), port);
     connect(addr, port);  
157    }    }
158    
159    /**    /**
# Line 161  class PlainSocketImpl extends SocketImpl Line 167  class PlainSocketImpl extends SocketImpl
167    protected native void connect(InetAddress addr, int port)    protected native void connect(InetAddress addr, int port)
168      throws IOException;      throws IOException;
169    
170    public void connect(SocketAddress address, int timeout)    protected void connect(SocketAddress address, int timeout)
171    {    {
172      throw new InternalError ("PlainSocketImpl::connect not implemented");      throw new InternalError ("PlainSocketImpl::connect not implemented");
173    }    }
# Line 258  class PlainSocketImpl extends SocketImpl Line 264  class PlainSocketImpl extends SocketImpl
264     */     */
265    protected synchronized InputStream getInputStream() throws IOException    protected synchronized InputStream getInputStream() throws IOException
266    {    {
267      return(new SocketInputStream(this));      if (in == null)
268          in = new SocketInputStream (this);
269        
270        return in;
271    }    }
272    
273    /**    /**
# Line 271  class PlainSocketImpl extends SocketImpl Line 280  class PlainSocketImpl extends SocketImpl
280     */     */
281    protected synchronized OutputStream getOutputStream() throws IOException    protected synchronized OutputStream getOutputStream() throws IOException
282    {    {
283      return(new SocketOutputStream(this));      if (out == null)
284          out = new SocketOutputStream (this);
285        
286        return out;
287    }    }
288  }  }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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