multicast thread and TCP server running toghether,client can't connect..

i have programmed a simple java server that launches a multicast thread and right after that listens to the clients' connections on a TCP protocol and serves the client's request.

the multicast thread on the server is constantly listening for infos about the state of remote_servers that run on other machines and are RMI_dedicated to the work that the main server has to do for the client

i wrote all the code,but when i run it on my local machine,the multicast threads work and set themselves,but when i launch the client,the connection's refused and i can't figure out why..

all the multicast threads send/receive on a multicast address,by the time that the server puts himself on a serversocket.accept it should be able to get the client's connection,but no..

this is what the server does:

//-->start the Mainreceiver for the info about remoteworkers

to_workers = new MainReceiver(collection_remotes);

to_workers.run();

//-->initializing serversocket

try {

serv_sock = new ServerSocket(SERVERFARMPORT);

} catch(Exception e) {

e.printStackTrace();

System.out.println("error while creating serversocket on SERVERFARMPORT");

System.exit(-1);

}

//-->accepting connections and giving them to threads

while(true){

try {

client_sock = serv_sock.accept();

} catch (IOException e) {e.printStackTrace();}

//-->starting the dedicated client thread

cli_thread = new ClientServiceThread(client_sock,collection_remotes);

cli_thread.start();

}

hope i made the point,thanxalot

[1639 byte] By [Nihcolasa] at [2007-11-27 8:43:08]
# 1
> to_workers.run();to_workers.start();Is this really so difficult? If you had bothered to trace your program, you would have noticed that you never got to the part where you had created the server socket.
ejpa at 2007-7-12 20:42:40 > top of Java-index,Java Essentials,New To Java...
# 2
i found out too...yeah that was simple,but sometimes i stay on the code for so long i get tired and miss the easiest things!..anyway thanxalot,and sorry!
Nihcolasa at 2007-7-12 20:42:40 > top of Java-index,Java Essentials,New To Java...
# 3
Moral: don't do that.Go out to lunch.Go home at night.I always find that the fixes for the hard bugs pop into my head in the shower, or while shaving, next morning.
ejpa at 2007-7-12 20:42:40 > top of Java-index,Java Essentials,New To Java...