virtual bool operator() (RedChannel& channel) { if (channel.get_type() == SPICE_CHANNEL_CURSOR && channel.get_id() == _channel.get_id()) { static_cast<CursorChannel&>(channel).detach_display(); return true; } return false; }
virtual bool operator() (RedChannel& channel) { if (channel.get_type() == SPICE_CHANNEL_CURSOR && channel.get_id() == _channel.get_id()) { static_cast<CursorChannel&>(channel).attach_display(&_channel); } else if (channel.get_type() == SPICE_CHANNEL_INPUTS) { _channel.attach_inputs(&static_cast<InputsChannel&>(channel)); } return false; }
void RedClient::create_channel(uint32_t type, uint32_t id) { ChannelFactory* factory = find_factory(type); if (!factory) { return; } RedChannel* channel = factory->construct(*this, id); ASSERT(channel); Lock lock(_channels_lock); _channels.push_back(channel); channel->start(); channel->connect(); _migrate.add_channel(new MigChannel(type, id, channel->get_common_caps(), channel->get_caps())); }
void* RedChannel::worker_main(void *data) { try { RedChannel* channel = static_cast<RedChannel*>(data); channel->set_state(DISCONNECTED_STATE); Platform::set_thread_priority(NULL, channel->get_worker_priority()); channel->run(); } catch (Exception& e) { LOG_ERROR("unhandled exception: %s", e.what()); } catch (std::exception& e) { LOG_ERROR("unhandled exception: %s", e.what()); } catch (...) { LOG_ERROR("unhandled exception"); } return NULL; }
void RedClient::on_channel_disconnected(RedChannel& channel) { Lock lock(_notify_lock); if (_notify_disconnect) { _notify_disconnect = false; int connection_error = channel.get_connection_error(); AutoRef<DisconnectedEvent> disconn_event(new DisconnectedEvent(connection_error)); push_event(*disconn_event); } disconnect_channels(); RedPeer::disconnect(); }
void RedClient::migrate_channel(RedChannel& channel) { DBG(0, "channel type %u id %u", channel.get_type(), channel.get_id()); _migrate.swap_peer(channel); }