remote_recv_thread
error = pthread_create(&td, NULL, remote_recv_thread, res);
static void *remote_recv_thread(void *arg);