-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemotePeerInfo.java
More file actions
31 lines (25 loc) · 910 Bytes
/
RemotePeerInfo.java
File metadata and controls
31 lines (25 loc) · 910 Bytes
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
package unimelb.bitbox;
import java.net.Socket;
// Records an instance of our peer infterface connecting with a remote peer.
// Our peer interface consists of:
// A socket to a remote peer.
// A transmitter thread to accept all input stream and send RESPONSEs to REQUESTs
// A receiver thread sends all updated events' REQUEST.
// (and maybe several file writer threads to write files parallelly)
public class RemotePeerInfo {
//remote peer info
String host;
int port;
Socket socket;
TransmitterThread transmitter;
ReceiverThread receiver;
public RemotePeerInfo(String host, int port, Socket socket,
TransmitterThread transmitter,
ReceiverThread receiver) {
this.host = host;
this.port = port;
this.socket = socket;
this.transmitter = transmitter;
this.receiver = receiver;
}
}