close
public void myMethod() {
try {
ServerSocket serverSocket = new ServerSocket(5555);
while (true) {
Socket socket = serverSocket.accept();
// 底下處理連上來的 socket
...
}
} catch (IOException ex) {
}
}
全站熱搜
public void myMethod() {
try {
ServerSocket serverSocket = new ServerSocket(5555);
while (true) {
Socket socket = serverSocket.accept();
// 底下處理連上來的 socket
...
}
} catch (IOException ex) {
}
}