Changeset 2:fec77d29a663 in xplra
- Timestamp:
- 01/03/13 12:31:04 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/xplra
- Files:
-
- 5 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/xplra/ListenThread.cc
r1 r2 31 31 #include "ListenThread.h" 32 32 33 #include "ServerThread.h" 34 35 #include <xplcommon/LocalServerSocket.h> 36 #include <xplcommon/LocalAcceptor.h> 33 37 #include <xplcommon/Util.h> 34 38 … … 37 41 using xplra::ListenThread; 38 42 43 using xplcommon::LocalServerSocket; 44 using xplcommon::LocalAcceptor; 39 45 using xplcommon::Util; 40 46 … … 45 51 Util::debug("xplra::ListenThread::run: started\n"); 46 52 47 while(!quitEvent.check() && !quitEvent.failed()) { 53 LocalServerSocket socket("xplra", &waiter); 54 LocalAcceptor& acceptor = socket.getAcceptor(); 55 while(!quitEvent.check() && !quitEvent.failed() && !acceptor.failed()) { 56 if (acceptor.accept()) { 57 ServerThread* serverThread = new ServerThread(acceptor); 58 serverThread->start(); 59 } 48 60 waiter.wait(); 49 61 } 62 63 ServerThread::quitAll(); 50 64 51 65 Util::debug("xplra::ListenThread::run: quitting\n"); -
src/xplra/ListenThread.h
r0 r2 31 31 //------------------------------------------------------------------------------ 32 32 33 #include "RequestQueue.h" 34 33 35 #include <xplcommon/Thread.h> 34 36 #include <xplcommon/Waiter.h> … … 60 62 */ 61 63 xplcommon::WaitableEvent quitEvent; 64 65 /** 66 * The queue for the requests. 67 */ 68 RequestQueue requestQueue; 62 69 63 70 public: … … 92 99 inline void ListenThread::quit() 93 100 { 101 requestQueue.disable(); 94 102 quitEvent.fire(); 95 103 } -
src/xplra/Makefile.am
r1 r2 3 3 AM_CXXFLAGS=$(LIBXPLCOMMON_CFLAGS) 4 4 5 AM_CPPFLAGS=-DXPLM210 6 5 7 if TARGET_API_WIN32 6 AM_CPPFLAGS =-DIBM8 AM_CPPFLAGS+=-DIBM 7 9 AM_LDFLAGS=@XPSDK_LDFLAGS@ -no-undefined 8 10 if TARGET_API_WIN64 … … 14 16 15 17 if TARGET_API_POSIX 16 AM_CPPFLAGS =-DLIN18 AM_CPPFLAGS+=-DLIN 17 19 AM_CXXFLAGS+=-fPIC -fno-stack-protector 18 20 endif 21 19 22 20 23 lib_LTLIBRARIES=libxplra.la … … 22 25 libxplra_la_SOURCES= \ 23 26 plugin.cc \ 24 ListenThread.cc 27 ListenThread.cc \ 28 RequestQueue.cc \ 29 ServerThread.cc 25 30 26 31 libxplra_la_LIBADD=$(LIBXPLCOMMON_LIBS) 27 32 28 33 noinst_HEADERS= \ 29 ListenThread.h 34 ListenThread.h \ 35 Request.h \ 36 RequestQueue.h \ 37 ServerThread.h
Note:
See TracChangeset
for help on using the changeset viewer.