socket: Remove redundant code.