Friday 15 August 2014

network programming - Java networking - Look for packets without blocking the thread? -



network programming - Java networking - Look for packets without blocking the thread? -

i'm creating networking utilities package, create easier create network applications, chat applications, games etc. wonder if it's possible to, in server thread, packets time, without blocking thread?

i want this, because, example, when i'm going create multiplayer server, don't want whole server blocked , unplayable because server looking packets tells server connecting.

what's best way of solving this?

to set joining detection in separate thread? also; how many threads can run in single application? should seek hold amount of threads downwards much possible? 4 threads much?

edit: set bring together detection in separate thread , class. then, while bring together detector active, checked packets , added them list of requests. then, server class, every update, checked if there gathered requests in bring together detection class.

sorry wrong reply before.

java network-programming

No comments:

Post a Comment