1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| package org.globus.net; |
17 |
| |
18 |
| import java.net.Socket; |
19 |
| import java.net.InetAddress; |
20 |
| import java.net.SocketException; |
21 |
| import java.io.IOException; |
22 |
| import java.io.InputStream; |
23 |
| import java.io.OutputStream; |
24 |
| |
25 |
| public class WrappedSocket extends Socket { |
26 |
| |
27 |
| protected Socket socket; |
28 |
| |
29 |
0
| protected WrappedSocket() {}
|
30 |
| |
31 |
444
| public WrappedSocket(Socket socket) {
|
32 |
444
| super();
|
33 |
444
| this.socket = socket;
|
34 |
| } |
35 |
| |
36 |
0
| public Socket getWrappedSocket() {
|
37 |
0
| return this.socket;
|
38 |
| } |
39 |
| |
40 |
0
| public OutputStream getOutputStream()
|
41 |
| throws IOException { |
42 |
0
| return this.socket.getOutputStream();
|
43 |
| } |
44 |
| |
45 |
0
| public synchronized InputStream getInputStream()
|
46 |
| throws IOException { |
47 |
0
| return this.socket.getInputStream();
|
48 |
| } |
49 |
| |
50 |
0
| public void close()
|
51 |
| throws IOException { |
52 |
0
| this.socket.close();
|
53 |
| } |
54 |
| |
55 |
441
| public InetAddress getInetAddress() {
|
56 |
441
| return this.socket.getInetAddress();
|
57 |
| } |
58 |
| |
59 |
0
| public boolean getKeepAlive()
|
60 |
| throws SocketException { |
61 |
0
| return this.socket.getKeepAlive();
|
62 |
| } |
63 |
| |
64 |
0
| public InetAddress getLocalAddress() {
|
65 |
0
| return this.socket.getLocalAddress();
|
66 |
| } |
67 |
| |
68 |
0
| public int getLocalPort() {
|
69 |
0
| return this.socket.getLocalPort();
|
70 |
| } |
71 |
| |
72 |
0
| public int getPort() {
|
73 |
0
| return this.socket.getPort();
|
74 |
| } |
75 |
| |
76 |
0
| public int getReceiveBufferSize()
|
77 |
| throws SocketException { |
78 |
0
| return this.socket.getReceiveBufferSize();
|
79 |
| } |
80 |
| |
81 |
0
| public int getSendBufferSize()
|
82 |
| throws SocketException { |
83 |
0
| return this.socket.getSendBufferSize();
|
84 |
| } |
85 |
| |
86 |
0
| public int getSoLinger()
|
87 |
| throws SocketException { |
88 |
0
| return this.socket.getSoLinger();
|
89 |
| } |
90 |
| |
91 |
0
| public int getSoTimeout()
|
92 |
| throws SocketException { |
93 |
0
| return this.socket.getSoTimeout();
|
94 |
| } |
95 |
| |
96 |
0
| public boolean getTcpNoDelay()
|
97 |
| throws SocketException { |
98 |
0
| return this.socket.getTcpNoDelay();
|
99 |
| } |
100 |
| |
101 |
0
| public void setKeepAlive(boolean on)
|
102 |
| throws SocketException { |
103 |
0
| this.socket.setKeepAlive(on);
|
104 |
| } |
105 |
| |
106 |
18
| public void setReceiveBufferSize(int size)
|
107 |
| throws SocketException { |
108 |
18
| this.socket.setReceiveBufferSize(size);
|
109 |
| } |
110 |
| |
111 |
18
| public void setSendBufferSize(int size)
|
112 |
| throws SocketException { |
113 |
18
| this.socket.setSendBufferSize(size);
|
114 |
| } |
115 |
| |
116 |
0
| public void setSoLinger(boolean on,
|
117 |
| int linger) |
118 |
| throws SocketException { |
119 |
0
| this.socket.setSoLinger(on, linger);
|
120 |
| } |
121 |
| |
122 |
0
| public void setSoTimeout(int timeout)
|
123 |
| throws SocketException { |
124 |
0
| this.socket.setSoTimeout(timeout);
|
125 |
| } |
126 |
| |
127 |
0
| public void setTcpNoDelay(boolean on)
|
128 |
| throws SocketException { |
129 |
0
| this.socket.setTcpNoDelay(on);
|
130 |
| } |
131 |
| |
132 |
0
| public void shutdownInput()
|
133 |
| throws IOException { |
134 |
0
| this.socket.shutdownInput();
|
135 |
| } |
136 |
| |
137 |
0
| public void shutdownOutput()
|
138 |
| throws IOException { |
139 |
0
| this.socket.shutdownOutput();
|
140 |
| } |
141 |
| |
142 |
72
| public String toString() {
|
143 |
72
| return this.socket.toString();
|
144 |
| } |
145 |
| } |