/[classpath]/classpath/gnu/CORBA/SocketRepository.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/SocketRepository.java

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

revision 1.2 by mark, Sat Jul 2 20:32:09 2005 UTC revision 1.3 by audriusa, Fri Sep 2 15:53:05 2005 UTC
# Line 39  exception statement from your version. * Line 39  exception statement from your version. *
39  package gnu.CORBA;  package gnu.CORBA;
40    
41  import java.net.Socket;  import java.net.Socket;
42    import java.net.SocketException;
43    
44  import java.util.HashMap;  import java.util.HashMap;
45    
# Line 70  public class SocketRepository Line 71  public class SocketRepository
71    
72    /**    /**
73     * Get a socket.     * Get a socket.
74     *     *
75     * @param key a socket key.     * @param key a socket key.
76     *     *
77     * @return an opened socket for reuse, null if no such     * @return an opened socket for reuse, null if no such available or it is
78     * available or it is closed.     * closed.
79     */     */
80    public static Socket get_socket(Object key)    public static Socket get_socket(Object key)
81    {    {
82      Socket s = (Socket) sockets.get(key);      Socket s = (Socket) sockets.get(key);
83      if (s != null && s.isClosed())      if (s == null)
84          return null;
85        else if (s.isClosed())
86        {        {
87          sockets.remove(key);          sockets.remove(key);
88          return null;          return null;
# Line 87  public class SocketRepository Line 90  public class SocketRepository
90      else      else
91        {        {
92          sockets.remove(key);          sockets.remove(key);
93            try
94              {
95                // Set one minute time out that will be changed later.
96                s.setSoTimeout(60*1000);
97              }
98            catch (SocketException e)
99              {
100                s = null;
101              }
102          return s;          return s;
103        }        }
104    }    }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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