Hallo,
Ich weiß nicht so richtig was das Problem ist,
daher post ich einfach mal ein bisschen Code:
Ich weiß nicht so richtig was das Problem ist,
daher post ich einfach mal ein bisschen Code:
Java:
public class OTClientController extends Thread {
private ObjectInputStream in;
private ObjectOutputStream out;
private Distributor dis;
public OTClientController(Socket client, Distributor dis) throws IOException {
super("OTClientController");
this.dis = dis;
//hier hängt er: java.net.SocketInputStream.socketRead0(java.io.FileDescriptor, byte[], int, int, int) line: not available [native method]
in = new ObjectInputStream(client.getInputStream());
out = new ObjectOutputStream(client.getOutputStream());
}
@Override
public void run() {
Object o;
try {
while((o = in.readObject()) != null){
dis.distribute(o, this);
}
} catch (IOException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
throw new Error("Check version! Can't find needed classes!",e);
}
}
public void send(Object o) throws IOException{
out.writeObject(o);
}
}