01: package vicazh.hyperpool.stream.net;
02:
03: import java.net.*;
04:
05: /**
06: * The socket class
07: *
08: * @author Victor Zhigunov
09: * @version 0.3.14
10: */
11: public class Socket {
12:
13: public java.net.Socket socket;
14:
15: /**
16: * @param socket
17: * socket
18: */
19: public Socket(java.net.Socket socket) {
20: this .socket = socket;
21: }
22:
23: private InetAddress address;
24:
25: /**
26: * @param address
27: * the remote address
28: */
29: public Socket(InetAddress address) {
30: this .address = address;
31: }
32:
33: /**
34: * Returns the remote address
35: *
36: * @return the remote address
37: */
38: public InetAddress getInetAddress() {
39: if (socket != null)
40: return socket.getInetAddress();
41: if (address != null)
42: return address;
43: return null;
44: }
45:
46: public Stream stream;
47: }
|