1 20 21 package org.jacorb.orb.iiop; 22 23 import java.io.*; 24 import java.net.*; 25 26 import org.apache.avalon.framework.configuration.*; 27 28 import org.jacorb.orb.IIOPAddress; 29 30 39 40 public class ServerIIOPConnection 41 extends IIOPConnection 42 { 43 44 public ServerIIOPConnection( Socket socket, 45 boolean is_ssl ) 46 throws IOException 47 { 48 super(); 49 50 this.socket = socket; 51 this.use_ssl = is_ssl; 53 54 in_stream = socket.getInputStream(); 55 out_stream = new BufferedOutputStream(socket.getOutputStream()); 56 57 } 58 59 60 public void configure(Configuration configuration) 61 throws ConfigurationException 62 { 63 super.configure(configuration); 64 65 IIOPAddress address = new IIOPAddress 66 ( 67 socket.getInetAddress().getHostAddress(), 68 socket.getPort() 69 ); 70 71 profile = new IIOPProfile(address, null); 72 profile.configure(configuration); 73 74 connection_info = address.toString(); 75 connected = true; 76 77 if (logger.isInfoEnabled()) 78 logger.info("Opened new server-side TCP/IP transport to " + 79 connection_info ); 80 } 81 82 83 public Socket getSocket() 84 { 85 return socket; 86 } 87 88 public synchronized void close() 89 { 90 if( socket != null ) 91 { 92 try 93 { 94 socket.close(); 95 96 if( in_stream != null ) 99 { 100 in_stream.close(); 101 } 102 103 if( out_stream != null ) 104 { 105 out_stream.close(); 106 } 107 } 108 catch (IOException ex) 109 { 110 throw to_COMM_FAILURE (ex); 111 } 112 113 socket = null; 114 connected = false; 115 116 if (logger.isInfoEnabled()) 117 logger.info("Closed server-side transport to " + 118 connection_info ); 119 } 120 } 121 122 public void connect (org.omg.ETF.Profile server_profile, long time_out) 123 { 124 } 126 } 127 | Popular Tags |