From: Manuel Nickschas Date: Sun, 16 Feb 2014 16:29:28 +0000 (+0100) Subject: Move all socket handling into RemotePeer X-Git-Tag: 0.10-beta1~18 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=b2169e5f4cbd3ce724c4808b62ddc2b8941219a5;hp=b2169e5f4cbd3ce724c4808b62ddc2b8941219a5 Move all socket handling into RemotePeer 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. ---