-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoggedInPeer.java
52 lines (43 loc) · 1.17 KB
/
LoggedInPeer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import java.net.Socket;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
public class LoggedInPeer {
private int tokenId;
private String ipAddress;
private int port;
private Socket socket;
private ObjectOutputStream output;
private ObjectInputStream input;
private SavedPeer user;
public LoggedInPeer(int tokenId, int port, Socket socket, ObjectOutputStream output,
ObjectInputStream input, SavedPeer user) {
this.tokenId = tokenId;
this.ipAddress = socket.getInetAddress().getHostAddress();
this.port = port;
this.socket = socket;
this.output = output;
this.input = input;
this.user = user;
}
public int getTokenId() {
return tokenId;
}
public Socket getSocket() {
return socket;
}
public ObjectOutputStream getOutputStream() {
return output;
}
public ObjectInputStream getInputStream() {
return input;
}
public String getIpAddress() {
return ipAddress;
}
public int getPort() {
return port;
}
public SavedPeer getUser() {
return user;
}
}