Problem on server side (Socket Programming)
Hi
I have a very weird problem. My application is a client server application and the server is running on a Unix machine ij the background using no-hup command. The problem is that after some days of running in this case it is like 15 days there is no response form the server. i can not find the problem so I am posting a certain section of my code here. if any one can find any technical flaw in the code plz do let me know. i would really appreciate that.
Here is the Code:
import java.io.*;
import java.net.*;
import java.sql.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
public class Server
{
public static void main(String[] args)
{
ServerSocket s;
try
{
s = new ServerSocket(7000);
System.out.println("Server started");
while(true)
{
Socket incoming = s.accept( );
System.out.println("incoming " + incoming);
ThreadedDataObjectHandler t = new ThreadedDataObjectHandler(incoming);
t.start();
}
}
catch (Exception e)
{
}
}
static class ThreadedDataObjectHandler extends Thread
{
public ThreadedDataObjectHandler()
{
}
public ThreadedDataObjectHandler(Socket i)
{
incoming = i;
}
public void run()
{
try
{
//System.out.println("Server testing ");
//System.out.println("incoming " + incoming);
in = new ObjectInputStream(incoming.getInputStream());
out = new ObjectOutputStream(incoming.getOutputStream());
//System.out.println("in " + in);
//System.out.println("out " + out);
String strpassword = "";
ExtartingSurgeData extdata = null;
float []stationslevel = new float[6];
DataObject myobjecttowrite = new DataObject();
while(true)
{
// something //
}
Thanks