What are the "issues"? You've posted code and said there may be a problem with it, but you haven't said what you want it to do or what it actually does. How does its behavior deviate from the desired behavior? Perhaps have a look at How do I post a question effectively?
Update after the OP's update: My guess is you're suffering from buffering.
In reply to Re: Client/server issues
by kyle
in thread Client/server issues - Server is not receiving information until client closes the connection
by sergey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |