I have a java applet and is going with something besides her and as I am an expert in java programming I am not able to solve. This application uses socket communication + bytebuffer bytebuffer and that I store some information on the type (short int + + String) and sent over the network using socket. Well, that's OK, no problem, my problem is in the following situation:

public class Worker {
...
public worker(string channelDesc) {
workerChannel = new Communicator(channelDesc);
this.start()
}

public void run() {

workerChannel.SendMessages(....);
}
...
}

In this situation the message is written to the channel, but the server can not read the message. Now when I do

public class Worker {

...
public worker(string channelDesc) {
this.serverChannel = channelDesc;
this.start()
}

public void run() {
workerChannel = new Communicator(serverChannel);
workerChannel.SendMessages(....);
}

...
}

The message is sent and received (write and read), my problem is that this new Communicator (...) must be in the constructor method of the Worker and not the thread. For my understanding of java threads + the former situation would work or not?