J
JONESEY
I have the following Server thread:
import java.net.*;
import java.io.*;
import java.util.*;
public class mobileServerThread extends Thread
{
private Socket ThreadSocket;
private BufferedReader ThreadReader = null;
private String ThreadUser;
private PrintWriter ThreadWriter = null;
public mobileServerThread(Socket TSocket)
{
ThreadSocket = TSocket;
}
protected static Vector client_threads = new Vector ();
public void run ()
{
try
{
// get input & output streams
ThreadWriter = new
PrintWriter(ThreadSocket.getOutputStream(), true);
ThreadReader = new BufferedReader(new
InputStreamReader(ThreadSocket.getInputStream()));
// add this thread to client_threads
client_threads.addElement (this);
String from_client = ThreadReader.readLine();
}
catch (IOException e)
{
System.err.println("I/O problem in serve client1" + e);
System.exit(1);
}
finally
{
// remove this thread from client_threads
client_threads.removeElement (this);
try
{
// close input & output streams and socket
ThreadReader.close();
ThreadWriter.close();
ThreadSocket.close();
}
catch (IOException e)
{
System.err.println("I/O problem : " + e);
System.exit(1);
}
// stop this thread
this.stop();
}
}
}
I use the following code to create an instance of this
mobileServerThread serverThread = new mobileServerThread(client);
But im getting the follwoing error:
mobileServer.java [39:1] cannot resolve symbol
symbol : constructor mobileServerThread (java.net.Socket)
location: class mobileServerThread
mobileServerThread serverThread = new
mobileServerThread(client);
This was working and now all of a sudden it stopped. Any ideas whats
wrong with this
J
import java.net.*;
import java.io.*;
import java.util.*;
public class mobileServerThread extends Thread
{
private Socket ThreadSocket;
private BufferedReader ThreadReader = null;
private String ThreadUser;
private PrintWriter ThreadWriter = null;
public mobileServerThread(Socket TSocket)
{
ThreadSocket = TSocket;
}
protected static Vector client_threads = new Vector ();
public void run ()
{
try
{
// get input & output streams
ThreadWriter = new
PrintWriter(ThreadSocket.getOutputStream(), true);
ThreadReader = new BufferedReader(new
InputStreamReader(ThreadSocket.getInputStream()));
// add this thread to client_threads
client_threads.addElement (this);
String from_client = ThreadReader.readLine();
}
catch (IOException e)
{
System.err.println("I/O problem in serve client1" + e);
System.exit(1);
}
finally
{
// remove this thread from client_threads
client_threads.removeElement (this);
try
{
// close input & output streams and socket
ThreadReader.close();
ThreadWriter.close();
ThreadSocket.close();
}
catch (IOException e)
{
System.err.println("I/O problem : " + e);
System.exit(1);
}
// stop this thread
this.stop();
}
}
}
I use the following code to create an instance of this
mobileServerThread serverThread = new mobileServerThread(client);
But im getting the follwoing error:
mobileServer.java [39:1] cannot resolve symbol
symbol : constructor mobileServerThread (java.net.Socket)
location: class mobileServerThread
mobileServerThread serverThread = new
mobileServerThread(client);
This was working and now all of a sudden it stopped. Any ideas whats
wrong with this
J