Stubs Socket.connected function and related stuff