Friends here is my client program in java using sockets
import java.io.*;
import java.net.*;
class Client
{
int count=0;
public static void main(String args[]) throws Exception
{
int count=0;
Socket s=new Socket("LocalHost",2000);
DataOutputStream dos=new DataOutputStream(s.getOutputStream());
String str=new String();
while(true)
{
try
{
Thread.sleep(1000);
count++;
str=""+count+"";
dos.writeBytes("str");
System.out.println(str);
}
catch(Exception e)
{}
}
}
}

Here client sends number(actually string) to server by using thread and incrementing a variable for every 1 second.

And server program is
import java.io.*;
import java.net.*;
class Server
{
public static void main(String args[]) throws Exception
{
ServerSocket ss=new ServerSocket(2000);
Socket s=ss.accept();
DataInputStream dis=new DataInputStream(s.getInputStream());
String str=dis.readLine();
System.out.println("While");
while(true)
{
System.out.println(str);
str=dis.readLine();
}
}
}

Now the big problem is server is not getting data from server but client is posting the values the server program sucks in the line "String str=dis.readLine();"..
So please help me in getting this code..
Thanks.....