コード例 #1
0
ファイル: Client.cpp プロジェクト: 335/synergy
void
Client::handleOutputError(const Event&, void*)
{
	cleanupTimer();
	cleanupScreen();
	cleanupConnection();
	LOG((CLOG_WARN "error sending to server"));
	sendEvent(m_events->forClient().disconnected(), NULL);
}
コード例 #2
0
ファイル: Client.cpp プロジェクト: 335/synergy
void
Client::handleDisconnected(const Event&, void*)
{
	cleanupTimer();
	cleanupScreen();
	cleanupConnection();
	LOG((CLOG_DEBUG1 "disconnected"));
	sendEvent(m_events->forClient().disconnected(), NULL);
}
コード例 #3
0
ファイル: CClient.cpp プロジェクト: brainiac/SynergyKM
void
CClient::handleDisconnected(const CEvent&, void*)
{
	cleanupTimer();
	cleanupScreen();
	cleanupConnection();
	LOG((CLOG_DEBUG1 "disconnected"));
	sendEvent(getDisconnectedEvent(), NULL);
}
コード例 #4
0
ファイル: CClient.cpp プロジェクト: brainiac/SynergyKM
void
CClient::handleOutputError(const CEvent&, void*)
{
	cleanupTimer();
	cleanupScreen();
	cleanupConnection();
	LOG((CLOG_WARN "error sending to server"));
	sendEvent(getDisconnectedEvent(), NULL);
}
コード例 #5
0
ファイル: Client.cpp プロジェクト: 335/synergy
void
Client::handleConnectTimeout(const Event&, void*)
{
	cleanupTimer();
	cleanupConnecting();
	cleanupConnection();
	cleanupStream();
	LOG((CLOG_DEBUG1 "connection timed out"));
	sendConnectionFailedEvent("Timed out");
}
コード例 #6
0
ファイル: CClient.cpp プロジェクト: brainiac/SynergyKM
void
CClient::handleConnectTimeout(const CEvent&, void*)
{
	cleanupTimer();
	cleanupConnecting();
	cleanupConnection();
	delete m_stream;
	m_stream = NULL;
	LOG((CLOG_DEBUG1 "connection timed out"));
	sendConnectionFailedEvent("Timed out");
}
コード例 #7
0
ファイル: Client.cpp プロジェクト: 335/synergy
void
Client::handleHello(const Event&, void*)
{
	SInt16 major, minor;
	if (!ProtocolUtil::readf(m_stream, kMsgHello, &major, &minor)) {
		sendConnectionFailedEvent("Protocol error from server, check encryption settings");
		cleanupTimer();
		cleanupConnection();
		return;
	}

	// check versions
	LOG((CLOG_DEBUG1 "got hello version %d.%d", major, minor));
	if (major < kProtocolMajorVersion ||
		(major == kProtocolMajorVersion && minor < kProtocolMinorVersion)) {
		sendConnectionFailedEvent(XIncompatibleClient(major, minor).what());
		cleanupTimer();
		cleanupConnection();
		return;
	}

	// say hello back
	LOG((CLOG_DEBUG1 "say hello version %d.%d", kProtocolMajorVersion, kProtocolMinorVersion));
	ProtocolUtil::writef(m_stream, kMsgHelloBack,
							kProtocolMajorVersion,
							kProtocolMinorVersion, &m_name);

	// now connected but waiting to complete handshake
	setupScreen();
	cleanupTimer();

	// make sure we process any remaining messages later.  we won't
	// receive another event for already pending messages so we fake
	// one.
	if (m_stream->isReady()) {
		m_events->addEvent(Event(m_events->forIStream().inputReady(),
							m_stream->getEventTarget()));
	}
}
コード例 #8
0
ファイル: runtime.c プロジェクト: firedrakeproject/petsc
int main(int argc, char *argv[])
{
  MLENV env;
  MLINK link;
  int   ierr;

  ierr = PetscInitialize(&argc, &argv, NULL, help);if (ierr) return(ierr);
  ierr = setupConnection(&env, &link, "192.168.119.1", MATHEMATICA_LINK_CONNECT);CHKERRQ(ierr);
  ierr = processPackets(link);CHKERRQ(ierr);
  ierr = cleanupConnection(env, link);CHKERRQ(ierr);
  ierr = PetscFinalize();
  return(ierr);
}
コード例 #9
0
ファイル: CClient.cpp プロジェクト: JueSungMun/SPWC
CClient::~CClient()
{
	EVENTQUEUE->removeHandler(IScreen::getSuspendEvent(),
							  getEventTarget());
	EVENTQUEUE->removeHandler(IScreen::getResumeEvent(),
							  getEventTarget());

	cleanupTimer();
	cleanupScreen();
	cleanupConnecting();
	cleanupConnection();
	delete m_socketFactory;
	delete m_streamFilterFactory;
}
コード例 #10
0
ファイル: Client.cpp プロジェクト: 335/synergy
void
Client::disconnect(const char* msg)
{
	m_connectOnResume = false;
	cleanupTimer();
	cleanupScreen();
	cleanupConnecting();
	cleanupConnection();
	if (msg != NULL) {
		sendConnectionFailedEvent(msg);
	}
	else {
		sendEvent(m_events->forClient().disconnected(), NULL);
	}
}
コード例 #11
0
ファイル: Client.cpp プロジェクト: Ameb/synergy
Client::~Client()
{
	if (m_mock) {
		return;
	}

	m_events->removeHandler(m_events->forIScreen().suspend(),
							  getEventTarget());
	m_events->removeHandler(m_events->forIScreen().resume(),
							  getEventTarget());

	cleanupTimer();
	cleanupScreen();
	cleanupConnecting();
	cleanupConnection();
	delete m_socketFactory;
}
コード例 #12
0
ファイル: CClient.cpp プロジェクト: brainiac/SynergyKM
CClient::~CClient()
{
	// HACK: can't disable dtor with mocks
	if (m_mock)
		return;

	m_eventQueue.removeHandler(IScreen::getSuspendEvent(),
							  getEventTarget());
	m_eventQueue.removeHandler(IScreen::getResumeEvent(),
							  getEventTarget());

	cleanupTimer();
	cleanupScreen();
	cleanupConnecting();
	cleanupConnection();
	delete m_socketFactory;
	delete m_streamFilterFactory;
}