Implement RealSocket instead of casting to Socket