TCP output not working well

i am outputting to a simple tcp server that accepts connection on port X and displays out comes to stdout, and in logstash i am outputting to port X on the address where is the server and to local stdout.

the issue is this, when i send Y logs to logstash, i receive Y logs after parsing in the server.
but if i send again, noting comes to the server, but i can see also in local stdout that log stash parsed the input.

i have shut down the server and brought it up again, and then i saw the other parsed logs received.
this behaviour suggest that log stash makes new tcp session after certain log parsing session.
so i need to reaccept a new connection in the server.

any one have a fix for this kind of behaviour?