Package com.sun.rpc

Class Connection

java.lang.Object
java.lang.Thread
com.sun.rpc.Connection
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
ConnectDatagram, ConnectSocket

public abstract class Connection extends Thread
Sets up a connection to the server using either UDP or TCP as determined by the subclass. This class also handles the connection caching.
Author:
Brent Callaghan
See Also:
  • Field Details

    • server

      public String server
    • port

      public int port
  • Constructor Details

    • Connection

      public Connection(String server, int port, String proto, int maxSize)
      Construct a new connection to a specified server and port using protocol proto with a reply buffer of size maxsize.
      Parameters:
      server - The hostname of the server
      port - The port number on the server
  • Method Details

    • getCache

      public static Connection getCache(String server, int port, String proto)
      Get a cached connection for the specified server, port and protocol
      Parameters:
      server - The hostname of the server
      port - The port number on the server
      proto - The connection type: "tcp" or "udp"
    • putCache

      public static void putCache(Connection conn)
      Stash a new connection in the cache
      Parameters:
      The - connection to be cached
    • toString

      public String toString()
      Return information about the connection
      Overrides:
      toString in class Thread
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread