Changeset 11:9adb0b9c456b in xplcommon


Ignore:
Timestamp:
12/29/12 09:03:23 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 2 'hg:/home/ivaradi/xplane/hg/xplcommon' '/'>, 'public')
Message:

Implemented the server side of the local socket

Files:
5 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/xplcommon/posix/Acceptor.h

    r6 r11  
    5252class Acceptor : public ::xplcommon::Failable
    5353{
    54 private:
     54protected:
    5555    /**
    5656     * The socket we belong to.
     
    5858    ServerSocket& socket;
    5959
    60 protected:
    6160    /**
    6261     * The file descriptor accepted the last time.
  • src/xplcommon/posix/Makefile.am

    r6 r11  
    1313        Socket.cc               \
    1414        Connector.cc            \
    15         ClientSocket.cc
     15        ClientSocket.cc         \
     16        LocalServerSocket.cc
    1617
    1718include_xplcommon_posixdir=$(includedir)/xplcommon/posix
     
    2930        Socket.h                \
    3031        Connector.h             \
    31         ClientSocket.h
     32        ClientSocket.h          \
     33        LocalSocket.h           \
     34        LocalAcceptor.h         \
     35        LocalServerSocket.h
  • src/xplcommon/posix/Socket.h

    r6 r11  
    6767           size_t writingCapacity = DEFAULT_CAPACITY);
    6868
     69    /**
     70     * Construct the socket with the given file descriptor.
     71     */
     72    Socket(int fd, Waiter* waiter = 0,
     73           size_t readingCapacity = DEFAULT_CAPACITY,
     74           size_t writingCapacity = DEFAULT_CAPACITY);
     75
    6976public:
    7077    /**
     
    8996//------------------------------------------------------------------------------
    9097
     98inline Socket::Socket(int fd, Waiter* waiter,
     99                      size_t readingCapacity, size_t writingCapacity) :
     100    BufferedWaitable(waiter, fd, readingCapacity, writingCapacity)
     101{
     102}
     103
     104//------------------------------------------------------------------------------
     105
    91106} /* namespace xplcommon::posix */ } /* namespace xplcommon */
    92107
  • src/xplcommon/posix/Waitable.h

    r6 r11  
    8282
    8383    /**
     84     * Get the waiter.
     85     */
     86    Waiter* getWaiter() const;
     87
     88    /**
    8489     * Indicate if this waitable is valid, i.e. the file descriptor is
    8590     * non-negative.
     
    120125//------------------------------------------------------------------------------
    121126
     127inline Waiter* Waitable::getWaiter() const
     128{
     129    return waiter;
     130}
     131
     132//------------------------------------------------------------------------------
     133
    122134inline bool Waitable::isValid() const
    123135{
Note: See TracChangeset for help on using the changeset viewer.