Renamed Client.java to ClientThread.java
This commit is contained in:
parent
9037a8106f
commit
371efdf89c
@ -1,14 +1,13 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Client;
|
||||
|
||||
import java.awt.image.BufferStrategy;
|
||||
import java.io.*;
|
||||
import java.net.Socket;
|
||||
|
||||
public class Client implements Runnable {
|
||||
public class ClientThread implements Runnable {
|
||||
private int name;
|
||||
private final Socket socket;
|
||||
|
||||
public Client(int name, Socket socket) {
|
||||
public ClientThread(int name, Socket socket) {
|
||||
this.name = name;
|
||||
this.socket = socket;
|
||||
}
|
||||
@ -17,6 +16,9 @@ public class Client implements Runnable {
|
||||
try {
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
|
||||
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
|
||||
while(socket.isConnected()){
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@ -1,4 +1,23 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Server;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
|
||||
public class Server {
|
||||
|
||||
int port = 42069;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
try {
|
||||
ServerSocket gameServer = new ServerSocket(42069);
|
||||
System.out.println("Waiting for a connection on Port 42069");
|
||||
while(true) {
|
||||
Socket connector = gameServer.accept();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user