// streaming connections are per-session and have a fixed version. we can't do anything with a wrong-version stream connection, so drop it.
if (version != StreamMessage.CURRENT_VERSION)
throw new IOException(String.format("Received stream using protocol version %d (my version %d). Terminating connection", version, MessagingService.current_version));
DataInput input = new DataInputStream(socket.getInputStream());
StreamInitMessage init = StreamInitMessage.serializer.deserialize(input, version);
// We will use the current socket to incoming stream. So if the other side is the
// stream initiator, we must first create an outgoing stream, after which real streaming
// will start. If we were the initiator however, this socket will just be our incoming
// stream, everything is setup and we can initiate real streaming by sending the prepare message.