copy_to_buf and read_from_buf
receve thread structure added and tcp_close() added