Java Netwroking Problem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top