Originally posted by: Kilrsat
Originally posted by: amdfanboy
Originally posted by: Kilrsat
I use a "Connection" class attached to the key. Where that class knows/tracks what it needs and how to communicate with that specific client.
Was it the "it.remove()" that fixed your null pointer?
Amazingly yes, even thought I was already doing it just in a different place. *shrugs* I guess it's one of those things like hanging when you get the input stream before the output stream in some cases.
Anyway, thanks :beer:
Have any ideas about the headers? I think I might put the write method in the connection type class and have it handle the management of the headers.
Damn you have quick response time
Once the connection is accepted, I pawn all duties off onto the connection class. It keeps the server code more streamlined, and thus easier to fix. Once the server code says the key is writeable, it calls the write method of the connection, which may or may not actually write anything depending on the situation.