socket implementation for alice and bob