Changeset 18:0490048f256d in xplcommon for src


Ignore:
Timestamp:
12/29/12 11:05:33 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented basic test program for the sockets

Location:
src/xplcommon/posix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/xplcommon/posix/LocalServerSocket.cc

    r14 r18  
    3636#include <pwd.h>
    3737#include <unistd.h>
     38#include <poll.h>
    3839
    3940#include <sys/socket.h>
     
    8788//------------------------------------------------------------------------------
    8889
     90bool LocalServerSocket::isReady()
     91{
     92    return false;
     93}
     94
     95//------------------------------------------------------------------------------
     96
     97void LocalServerSocket::handleEvents(short events)
     98{
     99    if ((events&POLLIN)==POLLIN) {
     100        acceptor.accept();
     101    }
     102}
     103
     104//------------------------------------------------------------------------------
     105
    89106// Local Variables:
    90107// mode: C++
  • src/xplcommon/posix/LocalServerSocket.h

    r15 r18  
    9494    LocalAcceptor& getAcceptor();
    9595
     96protected:
     97    /**
     98     * Indicate if the waitable is ready, i.e. there is no need to
     99     * wait for it.
     100     */
     101    virtual bool isReady();
     102
     103    /**
     104     * Handle the given events.
     105     */
     106    virtual void handleEvents(short events);
     107
    96108    friend class LocalAcceptor;
    97109};
Note: See TracChangeset for help on using the changeset viewer.