Changeset 2:fec77d29a663 in xplra for src


Ignore:
Timestamp:
01/03/13 12:31:04 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The basic architecture is implemented

Location:
src/xplra
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/xplra/ListenThread.cc

    r1 r2  
    3131#include "ListenThread.h"
    3232
     33#include "ServerThread.h"
     34
     35#include <xplcommon/LocalServerSocket.h>
     36#include <xplcommon/LocalAcceptor.h>
    3337#include <xplcommon/Util.h>
    3438
     
    3741using xplra::ListenThread;
    3842
     43using xplcommon::LocalServerSocket;
     44using xplcommon::LocalAcceptor;
    3945using xplcommon::Util;
    4046
     
    4551    Util::debug("xplra::ListenThread::run: started\n");
    4652
    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        }
    4860        waiter.wait();
    4961    }
     62
     63    ServerThread::quitAll();
    5064
    5165    Util::debug("xplra::ListenThread::run: quitting\n");
  • src/xplra/ListenThread.h

    r0 r2  
    3131//------------------------------------------------------------------------------
    3232
     33#include "RequestQueue.h"
     34
    3335#include <xplcommon/Thread.h>
    3436#include <xplcommon/Waiter.h>
     
    6062     */
    6163    xplcommon::WaitableEvent quitEvent;
     64
     65    /**
     66     * The queue for the requests.
     67     */
     68    RequestQueue requestQueue;
    6269
    6370public:
     
    9299inline void ListenThread::quit()
    93100{
     101    requestQueue.disable();
    94102    quitEvent.fire();
    95103}
  • src/xplra/Makefile.am

    r1 r2  
    33AM_CXXFLAGS=$(LIBXPLCOMMON_CFLAGS)
    44
     5AM_CPPFLAGS=-DXPLM210
     6
    57if TARGET_API_WIN32
    6 AM_CPPFLAGS=-DIBM
     8AM_CPPFLAGS+=-DIBM
    79AM_LDFLAGS=@XPSDK_LDFLAGS@ -no-undefined
    810if TARGET_API_WIN64
     
    1416
    1517if TARGET_API_POSIX
    16 AM_CPPFLAGS=-DLIN
     18AM_CPPFLAGS+=-DLIN
    1719AM_CXXFLAGS+=-fPIC -fno-stack-protector
    1820endif
     21
    1922
    2023lib_LTLIBRARIES=libxplra.la
     
    2225libxplra_la_SOURCES= \
    2326        plugin.cc       \
    24         ListenThread.cc
     27        ListenThread.cc \
     28        RequestQueue.cc \
     29        ServerThread.cc
    2530
    2631libxplra_la_LIBADD=$(LIBXPLCOMMON_LIBS)
    2732
    2833noinst_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.