Move all socket handling into RemotePeer
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 16 Feb 2014 16:29:28 +0000 (17:29 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 16 Feb 2014 16:29:28 +0000 (17:29 +0100)
Previously we had the RemotePeer subclasses reading from and writing to
the socket themselves, resulting in code duplication and also making it
hard to have a single point for implementing compression support later.

We assume that any protocol we may come up with will send the size of
a datagram followed by the datagram itself, thus there's no need to
implement that part in the individual peers. And if we ever come up
with something else, we can always make some methods virtual and
override them for the special case.

We avoid using QDataStream in RemotePeer, as we are only reading/writing
QByteArrays anyway. That way, we can also replace the direct calls to
the socket by the layer implementing compression later, without it being
a proper QIODevice.


No differences found