initial stab at socket implementation