thread_run can output the stdout to a socket