implementing network

Thank you all for helping.
Matt, as I said when connection closes you get bombarded with read events until you close the connection on your side… and can’t do anything else… i couldn’t even get windows task manager to open until I switched to java application and closed it (thus killing server and read events). So i doubt you have that problem assuming you at least tested it for abnormal connection closing.

… and when I thought you tried to convince me to use JGN instead of learning how to write my own networking :slight_smile: … just kidding :stuck_out_tongue:

You’re using NIO for your read events? In JGN I don’t have that problem. I essentially call the update method that checks to see if there are any packets awaiting delivery (checking to see if the size is greater than 0) and if so I read it, otherwise I ignore and just return control back to the thread that called the update method.

Only a fool would say their code is perfect…there’s always more to learn and always more to improve. :-p

I can’t say I’m a networking professional really myself. In fact, the desire to write JGN was inspired really from my lack of desire to write networking as odd as that might seem. I wanted to create a project that would contain all the features necessary for any networking game I might write so that once it’s stable I don’t have to concern myself with networking anymore. ::slight_smile:

-Matt Hicks