Finalized socket implementation