dodo
September 30th, 2000, 12:23 PM
Hi
I build an APPLET program that work with TCP/IP
i success to connect a server and i success to
send data to the server but the problem is
to recv text from the server only when i close
the server i get the data he send me.
The server send me data and i don't get the data
until i close the server and then i get all the data he send me.
here is the Thread that recv the data
class RecvThread extends Thread
{
Socket socket = null;
BufferedReader in = null;
String info;
TextArea text;
RecvThread(Socket s,BufferedReader i,TextArea t)
{
this.socket = s;
this.in = i;
this.text = t;
}
public void run()
{
try
{
while ((info=in.readLine())!=null)
{
text.setText(text.getText() + " " + info);
}
}
catch (IOException e)
{
}
}
}
Why ???
Thak You
i will rate.
I build an APPLET program that work with TCP/IP
i success to connect a server and i success to
send data to the server but the problem is
to recv text from the server only when i close
the server i get the data he send me.
The server send me data and i don't get the data
until i close the server and then i get all the data he send me.
here is the Thread that recv the data
class RecvThread extends Thread
{
Socket socket = null;
BufferedReader in = null;
String info;
TextArea text;
RecvThread(Socket s,BufferedReader i,TextArea t)
{
this.socket = s;
this.in = i;
this.text = t;
}
public void run()
{
try
{
while ((info=in.readLine())!=null)
{
text.setText(text.getText() + " " + info);
}
}
catch (IOException e)
{
}
}
}
Why ???
Thak You
i will rate.