Moved the statistics creation for active sockets.