I'm not completely sure you can do this, but if you can, an extra class that extends Thread should work:
Have the normal class make the calls to the thread class:
public class b
{
public b()
{
new ThreadClass(socket,2001);
new ThreadClass(socket,2002);
}
}
public class ThreadClass extends Thread
{
public ThreadClass(Socket socket, int port)
{
//do some crap
}
}
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20