core/socket: code cleaning