There is nothing wrong in your code. few things is there any mechanism to identify the client at the server end? that identifies the client and resume the data sending like session tracking? or identifying the client?
as you mentioned i haven't run into any problems with speed up thing.
here is server
here is my client