Modified the stdin function to keep a connection open and reuse it, instead of opening a new connection per message