Index: src/xplcommon/posix/BufferedStream.cc
===================================================================
--- src/xplcommon/posix/BufferedStream.cc	(revision 16)
+++ src/xplcommon/posix/BufferedStream.cc	(revision 16)
@@ -0,0 +1,113 @@
+// Copyright (c) 2012 by István Váradi
+
+// This file is part of libxplcommon, a common utility library for
+// development related to X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "BufferedStream.h"
+
+#include "ReadingBuffer.h"
+#include "WritingBuffer.h"
+
+#include <unistd.h>
+#include <poll.h>
+
+//------------------------------------------------------------------------------
+
+using xplcommon::posix::BufferedStream;
+
+//------------------------------------------------------------------------------
+
+BufferedStream::BufferedStream(Waiter* waiter, int fd,
+                                   size_t readingCapacity,
+                                   size_t writingCapacity,
+                                   short events) :
+    Waitable(waiter, fd, events),
+    readingBuffer( (readingCapacity==0) ? 0 :
+                   new ReadingBuffer(readingCapacity, this)),
+    writingBuffer( (writingCapacity==0) ? 0 :
+                   new WritingBuffer(writingCapacity, this))
+{
+}
+
+//------------------------------------------------------------------------------
+
+BufferedStream::~BufferedStream()
+{
+    delete writingBuffer;
+    delete readingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+ssize_t BufferedStream::read(void* dest, size_t length)
+{
+    ssize_t result = ::read(fd, dest, length);
+    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
+        setErrorCodeFromErrno();
+    }
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+ssize_t BufferedStream::write(const void* src, size_t length)
+{
+    ssize_t result = ::write(fd, src, length);
+    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
+        setErrorCodeFromErrno();
+    }
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+bool BufferedStream::isReady()
+{
+    return false;
+}
+
+//------------------------------------------------------------------------------
+
+void BufferedStream::handleEvents(short ev)
+{
+    if ((ev&POLLIN)==POLLIN && readingBuffer!=0) {
+        readingBuffer->read();
+    }
+    if ((ev&POLLOUT)==POLLOUT && writingBuffer!=0) {
+        writingBuffer->write();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/xplcommon/posix/BufferedStream.h
===================================================================
--- src/xplcommon/posix/BufferedStream.h	(revision 16)
+++ src/xplcommon/posix/BufferedStream.h	(revision 16)
@@ -0,0 +1,170 @@
+// Copyright (c) 2012 by István Váradi
+
+// This file is part of libxplcommon, a common utility library for
+// development related to X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLCOMMON_POSIX_BUFFEREDSTREAM_H
+#define XPLCOMMON_POSIX_BUFFEREDSTREAM_H
+//------------------------------------------------------------------------------
+
+#include "Waitable.h"
+
+#include <cstdlib>
+
+//------------------------------------------------------------------------------
+
+namespace xplcommon { namespace posix {
+
+//------------------------------------------------------------------------------
+
+class ReadingBuffer;
+class WritingBuffer;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A waitable that has a read and/or a write buffer associated with
+ * it.
+ */
+class BufferedStream : public Waitable
+{
+public:
+    /**
+     * The default buffer capacity.
+     */
+    static const size_t DEFAULT_CAPACITY = 4096;
+
+private:
+    /**
+     * The reading buffer. It may be 0, if no reading buffer is
+     * associated with this waitable.
+     */
+    ReadingBuffer* readingBuffer;
+
+    /**
+     * The writing buffer. It may be 0, if no writing buffer is
+     * associated with this waitable.
+     */
+    WritingBuffer* writingBuffer;
+
+protected:
+    /**
+     * Construct the buffered waitable with the given capacities of
+     * the reading and writing buffers. If any of the capacities is 0,
+     * the corresponding buffer will not be created.
+     */
+    BufferedStream(Waiter* waiter = 0, int fd = -1,
+                     size_t readingCapacity = DEFAULT_CAPACITY,
+                     size_t writingCapacity = DEFAULT_CAPACITY,
+                     short events = 0);
+
+public:
+    /**
+     * Destroy the buffered waitable.
+     */
+    virtual ~BufferedStream();
+
+    /**
+     * Get the reference of the reading buffer. Note, that it can be a
+     * 0 reference, if the waitable has no reading buffer.
+     */
+    ReadingBuffer& getReadingBuffer();
+
+    /**
+     * Get the reference of the writing buffer. Note, that it can be a
+     * 0 reference, if the waitable has no writing buffer.
+     */
+    WritingBuffer& getWritingBuffer();
+
+protected:
+    /**
+     * Read using the file descriptor at most the given number of
+     * bytes into the given buffer.
+     *
+     * This default implementation uses the read(2) function for
+     * reading.
+     *
+     * @return the number of bytes read (0 in case of end-of-file or
+     * when the connection is closed), -1 on error. In case of error,
+     * the error code will be set up.
+     */
+    virtual ssize_t read(void* dest, size_t length);
+
+    /**
+     * Write using the file descriptor the given number of bytes from
+     * the given buffer.
+     *
+     * This default implementation uses the write(2) function for
+     * writing.
+     *
+     * @return the number of bytes written, or -1 on error. In case of error,
+     * the error code will be set up.
+     */
+    virtual ssize_t write(const void* src, size_t length);
+
+    /**
+     * Check if the waitable is ready.
+     */
+    virtual bool isReady();
+
+    /**
+     * Handle any events on the file descriptor.
+     */
+    virtual void handleEvents(short events);
+
+    friend class ReadingBuffer;
+    friend class WritingBuffer;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline ReadingBuffer& BufferedStream::getReadingBuffer()
+{
+    return *readingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+inline WritingBuffer& BufferedStream::getWritingBuffer()
+{
+    return *writingBuffer;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplcommon::posix */ } /* namespace xplcommon */
+
+//------------------------------------------------------------------------------
+#endif // XPLCOMMON_POSIX_BUFFEREDSTREAM_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/xplcommon/posix/BufferedWaitable.cc
===================================================================
--- src/xplcommon/posix/BufferedWaitable.cc	(revision 14)
+++ 	(revision )
@@ -1,113 +1,0 @@
-// Copyright (c) 2012 by István Váradi
-
-// This file is part of libxplcommon, a common utility library for
-// development related to X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "BufferedWaitable.h"
-
-#include "ReadingBuffer.h"
-#include "WritingBuffer.h"
-
-#include <unistd.h>
-#include <poll.h>
-
-//------------------------------------------------------------------------------
-
-using xplcommon::posix::BufferedWaitable;
-
-//------------------------------------------------------------------------------
-
-BufferedWaitable::BufferedWaitable(Waiter* waiter, int fd,
-                                   size_t readingCapacity,
-                                   size_t writingCapacity,
-                                   short events) :
-    Waitable(waiter, fd, events),
-    readingBuffer( (readingCapacity==0) ? 0 :
-                   new ReadingBuffer(readingCapacity, this)),
-    writingBuffer( (writingCapacity==0) ? 0 :
-                   new WritingBuffer(writingCapacity, this))
-{
-}
-
-//------------------------------------------------------------------------------
-
-BufferedWaitable::~BufferedWaitable()
-{
-    delete writingBuffer;
-    delete readingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-ssize_t BufferedWaitable::read(void* dest, size_t length)
-{
-    ssize_t result = ::read(fd, dest, length);
-    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
-        setErrorCodeFromErrno();
-    }
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-ssize_t BufferedWaitable::write(const void* src, size_t length)
-{
-    ssize_t result = ::write(fd, src, length);
-    if (result<0 && errno!=EAGAIN && errno!=EWOULDBLOCK) {
-        setErrorCodeFromErrno();
-    }
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-bool BufferedWaitable::isReady()
-{
-    return false;
-}
-
-//------------------------------------------------------------------------------
-
-void BufferedWaitable::handleEvents(short ev)
-{
-    if ((ev&POLLIN)==POLLIN && readingBuffer!=0) {
-        readingBuffer->read();
-    }
-    if ((ev&POLLOUT)==POLLOUT && writingBuffer!=0) {
-        writingBuffer->write();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/xplcommon/posix/BufferedWaitable.h
===================================================================
--- src/xplcommon/posix/BufferedWaitable.h	(revision 14)
+++ 	(revision )
@@ -1,170 +1,0 @@
-// Copyright (c) 2012 by István Váradi
-
-// This file is part of libxplcommon, a common utility library for
-// development related to X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLCOMMON_POSIX_BUFFEREDWAITABLE_H
-#define XPLCOMMON_POSIX_BUFFEREDWAITABLE_H
-//------------------------------------------------------------------------------
-
-#include "Waitable.h"
-
-#include <cstdlib>
-
-//------------------------------------------------------------------------------
-
-namespace xplcommon { namespace posix {
-
-//------------------------------------------------------------------------------
-
-class ReadingBuffer;
-class WritingBuffer;
-
-//------------------------------------------------------------------------------
-
-/**
- * A waitable that has a read and/or a write buffer associated with
- * it.
- */
-class BufferedWaitable : public Waitable
-{
-public:
-    /**
-     * The default buffer capacity.
-     */
-    static const size_t DEFAULT_CAPACITY = 4096;
-
-private:
-    /**
-     * The reading buffer. It may be 0, if no reading buffer is
-     * associated with this waitable.
-     */
-    ReadingBuffer* readingBuffer;
-
-    /**
-     * The writing buffer. It may be 0, if no writing buffer is
-     * associated with this waitable.
-     */
-    WritingBuffer* writingBuffer;
-
-protected:
-    /**
-     * Construct the buffered waitable with the given capacities of
-     * the reading and writing buffers. If any of the capacities is 0,
-     * the corresponding buffer will not be created.
-     */
-    BufferedWaitable(Waiter* waiter = 0, int fd = -1,
-                     size_t readingCapacity = DEFAULT_CAPACITY,
-                     size_t writingCapacity = DEFAULT_CAPACITY,
-                     short events = 0);
-
-public:
-    /**
-     * Destroy the buffered waitable.
-     */
-    virtual ~BufferedWaitable();
-
-    /**
-     * Get the reference of the reading buffer. Note, that it can be a
-     * 0 reference, if the waitable has no reading buffer.
-     */
-    ReadingBuffer& getReadingBuffer();
-
-    /**
-     * Get the reference of the writing buffer. Note, that it can be a
-     * 0 reference, if the waitable has no writing buffer.
-     */
-    WritingBuffer& getWritingBuffer();
-
-protected:
-    /**
-     * Read using the file descriptor at most the given number of
-     * bytes into the given buffer.
-     *
-     * This default implementation uses the read(2) function for
-     * reading.
-     *
-     * @return the number of bytes read (0 in case of end-of-file or
-     * when the connection is closed), -1 on error. In case of error,
-     * the error code will be set up.
-     */
-    virtual ssize_t read(void* dest, size_t length);
-
-    /**
-     * Write using the file descriptor the given number of bytes from
-     * the given buffer.
-     *
-     * This default implementation uses the write(2) function for
-     * writing.
-     *
-     * @return the number of bytes written, or -1 on error. In case of error,
-     * the error code will be set up.
-     */
-    virtual ssize_t write(const void* src, size_t length);
-
-    /**
-     * Check if the waitable is ready.
-     */
-    virtual bool isReady();
-
-    /**
-     * Handle any events on the file descriptor.
-     */
-    virtual void handleEvents(short events);
-
-    friend class ReadingBuffer;
-    friend class WritingBuffer;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline ReadingBuffer& BufferedWaitable::getReadingBuffer()
-{
-    return *readingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-inline WritingBuffer& BufferedWaitable::getWritingBuffer()
-{
-    return *writingBuffer;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplcommon::posix */ } /* namespace xplcommon */
-
-//------------------------------------------------------------------------------
-#endif // XPLCOMMON_POSIX_BUFFEREDWAITABLE_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/xplcommon/posix/ClientSocket.cc
===================================================================
--- src/xplcommon/posix/ClientSocket.cc	(revision 14)
+++ src/xplcommon/posix/ClientSocket.cc	(revision 16)
@@ -69,5 +69,5 @@
     }
 
-    BufferedWaitable::handleEvents(events);
+    BufferedStream::handleEvents(events);
 }
 
Index: src/xplcommon/posix/Makefile.am
===================================================================
--- src/xplcommon/posix/Makefile.am	(revision 15)
+++ src/xplcommon/posix/Makefile.am	(revision 16)
@@ -8,5 +8,5 @@
 	ReadingBuffer.cc	\
 	WritingBuffer.cc	\
-	BufferedWaitable.cc	\
+	BufferedStream.cc	\
 	Acceptor.cc		\
 	ServerSocket.cc		\
@@ -23,8 +23,8 @@
 	Waiter.h		\
 	WaitableEvent.h		\
-	WaitableBuffer.h	\
+	StreamBuffer.h		\
 	ReadingBuffer.h		\
 	WritingBuffer.h		\
-	BufferedWaitable.h	\
+	BufferedStream.h	\
 	Acceptor.h		\
 	ServerSocket.h		\
Index: src/xplcommon/posix/ReadingBuffer.cc
===================================================================
--- src/xplcommon/posix/ReadingBuffer.cc	(revision 14)
+++ src/xplcommon/posix/ReadingBuffer.cc	(revision 16)
@@ -32,5 +32,5 @@
 #include "ReadingBuffer.h"
 
-#include "BufferedWaitable.h"
+#include "BufferedStream.h"
 
 #include <poll.h>
@@ -47,17 +47,17 @@
 
     if (getLength()>0) {
-        waitable.events &= ~POLLIN;
+        stream.events &= ~POLLIN;
         return true;
     }
 
-    ssize_t result = waitable.read(getData(), getCapacity());
+    ssize_t result = stream.read(getData(), getCapacity());
     if (result<0) {
-        if (waitable.failed()) {
-            waitable.events &= ~POLLIN;
+        if (stream.failed()) {
+            stream.events &= ~POLLIN;
         } else {
-            waitable.events |= POLLIN;
+            stream.events |= POLLIN;
         }
     } else {
-        waitable.events &= ~POLLIN;
+        stream.events &= ~POLLIN;
         addLength(result);
     }
Index: src/xplcommon/posix/ReadingBuffer.h
===================================================================
--- src/xplcommon/posix/ReadingBuffer.h	(revision 6)
+++ src/xplcommon/posix/ReadingBuffer.h	(revision 16)
@@ -32,5 +32,5 @@
 //------------------------------------------------------------------------------
 
-#include "WaitableBuffer.h"
+#include "StreamBuffer.h"
 
 //------------------------------------------------------------------------------
@@ -47,5 +47,5 @@
  * amount of data read is 0, that indicates and end-of-file condition.
  */
-class ReadingBuffer : public WaitableBuffer
+class ReadingBuffer : public StreamBuffer
 {
 protected:
@@ -53,9 +53,9 @@
      * Construct the buffer.
      */
-    ReadingBuffer(size_t capacity, BufferedWaitable* waitable);
+    ReadingBuffer(size_t capacity, BufferedStream* stream);
 
 public:
     /**
-     * Read into the buffer using the buffered waitable if possible.
+     * Read into the buffer using the buffered stream if possible.
      *
      * If the buffer contains data, this function returns immediately
@@ -67,5 +67,5 @@
      * end-of-file or end-of-connection condition.
      *
-     * If the reading operation would block, the waitable is set up so
+     * If the reading operation would block, the stream is set up so
      * that it would read, and failure is returned.
      *
@@ -76,5 +76,5 @@
     bool read();
 
-    friend class BufferedWaitable;
+    friend class BufferedStream;
 };
 
@@ -83,7 +83,6 @@
 //------------------------------------------------------------------------------
 
-inline ReadingBuffer::ReadingBuffer(size_t capacity,
-                                    BufferedWaitable* waitable) :
-    WaitableBuffer(capacity, waitable)
+inline ReadingBuffer::ReadingBuffer(size_t capacity, BufferedStream* stream) :
+    StreamBuffer(capacity, stream)
 {
 }
Index: src/xplcommon/posix/Socket.h
===================================================================
--- src/xplcommon/posix/Socket.h	(revision 14)
+++ src/xplcommon/posix/Socket.h	(revision 16)
@@ -32,5 +32,5 @@
 //------------------------------------------------------------------------------
 
-#include "BufferedWaitable.h"
+#include "BufferedStream.h"
 
 //------------------------------------------------------------------------------
@@ -47,5 +47,5 @@
  * A buffered, waitable socket implementation.
  */
-class Socket : public BufferedWaitable
+class Socket : public BufferedStream
 {
 private:
@@ -85,5 +85,5 @@
 inline Socket::Socket(int domain, int type, Waiter* waiter, int protocol,
                       size_t readingCapacity, size_t writingCapacity) :
-    BufferedWaitable(waiter, socket(domain, type, protocol),
+    BufferedStream(waiter, socket(domain, type, protocol),
                      readingCapacity, writingCapacity)
 {
@@ -95,5 +95,5 @@
 inline Socket::Socket(int fd, Waiter* waiter,
                       size_t readingCapacity, size_t writingCapacity) :
-    BufferedWaitable(waiter, fd, readingCapacity, writingCapacity)
+    BufferedStream(waiter, fd, readingCapacity, writingCapacity)
 {
 }
Index: src/xplcommon/posix/StreamBuffer.h
===================================================================
--- src/xplcommon/posix/StreamBuffer.h	(revision 16)
+++ src/xplcommon/posix/StreamBuffer.h	(revision 16)
@@ -0,0 +1,112 @@
+// Copyright (c) 2012 by István Váradi
+
+// This file is part of libxplcommon, a common utility library for
+// development related to X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLCOMMON_POSIX_STREAMBUFFER_H
+#define XPLCOMMON_POSIX_STREAMBUFFER_H
+//------------------------------------------------------------------------------
+
+#include "../Buffer.h"
+#include "../Failable.h"
+
+#include "BufferedStream.h"
+
+//------------------------------------------------------------------------------
+
+namespace xplcommon { namespace posix {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for buffers used by a BufferedStream.
+ */
+class StreamBuffer : public ::xplcommon::Buffer,
+                     public ::xplcommon::FailableReference<StreamBuffer>
+{
+protected:
+    /**
+     * Our buffered stream.
+     */
+    BufferedStream& stream;
+
+protected:
+    /**
+     * Construct the buffer with the given waitable.
+     */
+    StreamBuffer(size_t capacity, BufferedStream* stream);
+
+private:
+    /**
+     * Get the failable object.
+     */
+    const ::xplcommon::Failable& getFailable() const;
+
+    /**
+     * Get the failable object.
+     */
+    ::xplcommon::Failable& getFailable();
+
+    friend class FailableReference<StreamBuffer>;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline StreamBuffer::StreamBuffer(size_t capacity, BufferedStream* stream) :
+    Buffer(capacity),
+    stream(*stream)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline const ::xplcommon::Failable& StreamBuffer::getFailable() const
+{
+    return stream;
+}
+
+//------------------------------------------------------------------------------
+
+inline ::xplcommon::Failable& StreamBuffer::getFailable()
+{
+    return stream;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplcommon::posix */ } /* namespace xplcommon */
+
+//------------------------------------------------------------------------------
+#endif // XPLCOMMON_POSIX_STREAMBUFFER_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/xplcommon/posix/WaitableBuffer.h
===================================================================
--- src/xplcommon/posix/WaitableBuffer.h	(revision 14)
+++ 	(revision )
@@ -1,113 +1,0 @@
-// Copyright (c) 2012 by István Váradi
-
-// This file is part of libxplcommon, a common utility library for
-// development related to X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLCOMMON_POSIX_WAITABLEBUFFER_H
-#define XPLCOMMON_POSIX_WAITABLEBUFFER_H
-//------------------------------------------------------------------------------
-
-#include "../Buffer.h"
-#include "../Failable.h"
-
-#include "BufferedWaitable.h"
-
-//------------------------------------------------------------------------------
-
-namespace xplcommon { namespace posix {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for buffers used by a BufferedWaitable.
- */
-class WaitableBuffer : public ::xplcommon::Buffer,
-                       public ::xplcommon::FailableReference<WaitableBuffer>
-{
-protected:
-    /**
-     * Our waitable.
-     */
-    BufferedWaitable& waitable;
-
-protected:
-    /**
-     * Construct the buffer with the given waitable.
-     */
-    WaitableBuffer(size_t capacity, BufferedWaitable* waitable);
-
-private:
-    /**
-     * Get the failable object.
-     */
-    const ::xplcommon::Failable& getFailable() const;
-
-    /**
-     * Get the failable object.
-     */
-    ::xplcommon::Failable& getFailable();
-
-    friend class FailableReference<WaitableBuffer>;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline WaitableBuffer::WaitableBuffer(size_t capacity,
-                                      BufferedWaitable* waitable) :
-    Buffer(capacity),
-    waitable(*waitable)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline const ::xplcommon::Failable& WaitableBuffer::getFailable() const
-{
-    return waitable;
-}
-
-//------------------------------------------------------------------------------
-
-inline ::xplcommon::Failable& WaitableBuffer::getFailable()
-{
-    return waitable;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplcommon::posix */ } /* namespace xplcommon */
-
-//------------------------------------------------------------------------------
-#endif // XPLCOMMON_POSIX_WAITABLEBUFFER_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/xplcommon/posix/WritingBuffer.cc
===================================================================
--- src/xplcommon/posix/WritingBuffer.cc	(revision 14)
+++ src/xplcommon/posix/WritingBuffer.cc	(revision 16)
@@ -32,5 +32,5 @@
 #include "WritingBuffer.h"
 
-#include "BufferedWaitable.h"
+#include "BufferedStream.h"
 
 #include <poll.h>
@@ -46,5 +46,5 @@
     Buffer::reset();
     offset = 0;
-    waitable.events &= ~POLLOUT;
+    stream.events &= ~POLLOUT;
 }
 
@@ -62,10 +62,10 @@
     size_t toWrite = getLength() - offset;
 
-    ssize_t result = waitable.write(getData() + offset, toWrite);
+    ssize_t result = stream.write(getData() + offset, toWrite);
     if (result<static_cast<ssize_t>(toWrite)) {
-        if (result<0 && waitable.failed()) {
-            waitable.events &= ~POLLOUT;
+        if (result<0 && stream.failed()) {
+            stream.events &= ~POLLOUT;
         } else {
-            waitable.events |= POLLOUT;
+            stream.events |= POLLOUT;
             if (result>0) offset += result;
         }
Index: src/xplcommon/posix/WritingBuffer.h
===================================================================
--- src/xplcommon/posix/WritingBuffer.h	(revision 6)
+++ src/xplcommon/posix/WritingBuffer.h	(revision 16)
@@ -32,5 +32,5 @@
 //------------------------------------------------------------------------------
 
-#include "WaitableBuffer.h"
+#include "StreamBuffer.h"
 
 //------------------------------------------------------------------------------
@@ -47,5 +47,5 @@
  * has been written. In that case the buffer is automatically emptied.
  */
-class WritingBuffer : public WaitableBuffer
+class WritingBuffer : public StreamBuffer
 {
 private:
@@ -59,5 +59,5 @@
      * Construct the buffer.
      */
-    WritingBuffer(size_t capacity, BufferedWaitable* waitable);
+    WritingBuffer(size_t capacity, BufferedStream* stream);
 
 public:
@@ -69,5 +69,5 @@
     /**
      * Write the contents of the buffer using the associated buffered
-     * waitable.
+     * stream.
      *
      * If the buffer is empty, the function returns indicating
@@ -79,5 +79,5 @@
      * If not everything can be written and the write operation
      * indicates that it would block, this function returns failure
-     * after the waitable has been set up  to handle the corresponding
+     * after the stream has been set up  to handle the corresponding
      * poll events.
      *
@@ -88,5 +88,5 @@
     bool write();
 
-    friend class BufferedWaitable;
+    friend class BufferedStream;
 };
 
@@ -95,7 +95,6 @@
 //------------------------------------------------------------------------------
 
-inline WritingBuffer::WritingBuffer(size_t capacity,
-                                    BufferedWaitable* waitable):
-    WaitableBuffer(capacity, waitable),
+inline WritingBuffer::WritingBuffer(size_t capacity, BufferedStream* stream):
+    StreamBuffer(capacity, stream),
     offset(0)
 {
