Hi Adam,

7 jun 2014 kl. 14:57 skrev Adam Warski <[email protected]>:

> Hello,
> 
> great to see actor producers merged :)
> 
> While doing some more experiments, I arrived at a question about TCP streams; 
> they are declared as a Producer[ByteString] and a Consumer[ByteString].
> The question is, are the ByteString instances sent by the server to the TCP 
> consumer treated as discrete messages, or a continuous stream of bytes which 
> can arrive in arbitrary chunks to the consumer?

TCP does not support datagram boundaries (that is what UDP does), it is just a 
stream of bytes which you get from the socket in arbitrary chunks (as defined 
by the operating system).

> 
> From what I have seen, on the client side I sometimes get a "single" 
> ByteString (exactly as sent by the server), sometimes multiple, concatenated. 
> Is it possible to receive only a chunk? Meaning that I should do the chunk 
> re-combination by hand?

You will typically need to add a custom framing protocol (e.g. by prepending a 
length field to every message).

Regards,

Roland

> 
> Adam
> 
> -- 
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to