tagging release
[dasher.git] / trunk / Src / DasherCore / SocketInput.cpp
blobfb0b0a408a8be1cfde075203c2eed39d049b5bef
1 // SocketInput.cpp
2 //
3 // (C) Copyright Seb Wills 2005
4 //
5 // Linux-specific subclass of SocketInputBase: provides network socket control of Dasher cursor
7 #include "../Common/Common.h"
9 #include "SocketInput.h"
10 #include "SocketInputBase.h"
12 #include <pthread.h>
13 #include <libintl.h>
15 #define _(_x) gettext(_x)
17 using namespace Dasher;
19 CSocketInput::CSocketInput(CEventHandler *pEventHandler, CSettingsStore *pSettingsStore)
20 :CSocketInputBase(pEventHandler, pSettingsStore) {
23 CSocketInput::~CSocketInput() {
24 StopListening();
27 // private methods:
29 bool CSocketInput::LaunchReaderThread() {
30 if (pthread_create(&readerThread, NULL, ThreadLauncherStub, this) == 0) {
31 return true;
32 } else {
33 //TODO should probably pop up a Gtk error message and think about how to do i18n:
34 cerr << _("Dasher socket input: failed to launch reader thread.") << endl;
35 return false;
39 void CSocketInput::CancelReaderThread() {
40 pthread_cancel(readerThread);