problem with socket......
below is the code for a client communicating with a server capable of handling multiple clients
problem is the this client sends the data and server recieves it but client is not able to read data sent by the server
but if i use awt where user request and response are handled in seperate thread it works....
publicclass dosclient1
{
publicstaticvoid main(String[] args)
{
new dosclient1();
}
Socket client;
DataInputStream dis;
DataOutputStream dout;
byte buff[]=newbyte[256];
byte buff1[]=newbyte[256];
dosclient1()
{
startclient();
}
void startclient()
{
try
{
InetAddress Server_ip=InetAddress.getByName("192.168.0.38");
int server_port=1999;
client=new Socket(Server_ip,server_port);
dis=new DataInputStream(client.getInputStream());
dout=new DataOutputStream(client.getOutputStream());
BufferedReader in =new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter Message :\t");// sending data to server
String request =in.readLine();
buff1 = request.getBytes();
dout.write(buff1);
do{// reading data sent by server
int s2=dis.read(buff);
String s=new String(buff ,0,s2);
System.out.println("\nResponse: \t"+s);
}while(true);
}
catch(Exception ex){System.out.println("Error"+ex);}
}
}
any suggestions......thanks

