Hello again !
Ok, I have cut my code to make it only 6 KB.
Finally, here is the problem : when I try to connect two clients to one server, both clients hang, and then I get the "connection rejected" error. It works with only one clients and several servers, so I guess my devices/services discovery is ok. I have tested how much clients my server can have (thanks to the LocalDevice.getProperty() method) : 7 on the Sun emulator, 5 on the Nokia emulator (Nokia 6230).
My guess is that the server send the same connection
string to all clients until someone connects, so they try to connect to the same channel ! What I would like to know is what is the correct implementation of the run method of the server to make it accept several clients ?
Here is the code of the server's run() method :
My Server class implements the Runnable interface. The constructor starts a Thread which contains my Server object. Note : "running" (boolean) is always true in this example.
What is wrong with this implementation ?
Thanks !
Thibault