change tcp_parte to non member function