rewrite com_consocket() that ugly piece of shit