forked from jonasagx/lib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDepartamento.java
More file actions
43 lines (34 loc) · 849 Bytes
/
Copy pathDepartamento.java
File metadata and controls
43 lines (34 loc) · 849 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
32
33
34
35
36
37
38
39
40
41
42
43
import java.io.IOException;
import java.net.ConnectException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.ArrayList;
public class Departamento {
private String name;
private InetAddress ip;
private InetAddress central;
private Socket con = null;
private Socket peer = null;
private ArrayList<Student> students = new ArrayList<Student>();
public Departamento(InetAddress central, String name) {
try {
this.ip = InetAddress.getLocalHost();
this.name = name;
this.central = central;
} catch (UnknownHostException e) {
e.printStackTrace();
}
}
public void connect(){
try {
this.con = new Socket(this.central, 8080);
} catch (IOException e) {
e.printStackTrace();
}
}
public void addStudent(){
}
public void updateCentral(){
}
}