inital plugin from webtools project
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.monitor.core / src / net / sourceforge / phpdt / monitor / core / internal / Connection.java
1 package net.sourceforge.phpdt.monitor.core.internal;
2
3 import java.net.Socket;
4 /**
5  * 
6  */
7 public class Connection {
8         protected Socket in;
9         protected Socket out;
10         
11         public Connection(Socket in, Socket out) {
12                 this.in = in;
13                 this.out = out;
14         }
15
16         public void close() {
17                 Trace.trace(Trace.FINEST, "Closing connection");
18                 try {
19                         in.getOutputStream().flush();
20                         in.shutdownInput();
21                         in.shutdownOutput();
22                         
23                         out.getOutputStream().flush();
24                         out.shutdownInput();
25                         out.shutdownOutput();
26                         Trace.trace(Trace.FINEST, "Connection closed");
27                 } catch (Exception ex) {
28                         Trace.trace(Trace.WARNING, "Error closing connection " + this + " " + ex.getMessage());
29                 }
30         }
31 }