M
mischka
Gast
hi,
in my thread which handles the handshake for incoming client connections i am using the following code:
readLine() blocks until it hits a termination like \n or the "EOF" has been reached.
this is fine as long as nobody sends endless datastreams (without termination characters) (flooding) - which would prevent other users to connect. is there a better way to solve this?
i also tried:
but for some reason this does not work with a normal client connection - the connection is ok
but there's no avaiable data.
is it possible to set a timeout for a inputstreamreader - so other clients are able to connect?
maybe somebody got an idea.
thanx,
mischka[/code]
in my thread which handles the handshake for incoming client connections i am using the following code:
Code:
BufferedReader reader = new BufferedReader(
new InputStreamReader(in));
String myQuery = reader.readLine();
this is fine as long as nobody sends endless datastreams (without termination characters) (flooding) - which would prevent other users to connect. is there a better way to solve this?
i also tried:
Code:
if(in.available() > 0)
{
query = new byte[in.available()];
in.read(query);
}
but there's no avaiable data.
is it possible to set a timeout for a inputstreamreader - so other clients are able to connect?
maybe somebody got an idea.
thanx,
mischka[/code]