Updated German translation
[dasher.git] / Src / DasherCore / SocketInput.cpp
blob2a7c3287f5a0bbb6cf9f6052027941747a498f29
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>
14 using namespace Dasher;
16 CSocketInput::CSocketInput(CSettingsUser *pCreator, CMessageDisplay *pMsgs)
17 :CSocketInputBase(pCreator, pMsgs) {
20 CSocketInput::~CSocketInput() {
21 StopListening();
24 // private methods:
26 bool CSocketInput::LaunchReaderThread() {
27 if (pthread_create(&readerThread, NULL, ThreadLauncherStub, this) == 0) {
28 return true;
29 } else {
30 //TODO should probably pop up a Gtk error message and think about how to do i18n:
31 cerr << _("Dasher socket input: failed to launch reader thread.") << endl;
32 return false;
36 void CSocketInput::CancelReaderThread() {
37 pthread_cancel(readerThread);