Handle multi-client streaming on the server

29 views
Skip to first unread message

tycz...@gmail.com

unread,
Aug 4, 2018, 10:06:55 AM8/4/18
to grpc.io
I am setting up a grpc service that will upload images in chunks to the server. What I am trying to understand in trying to setup the server logic is how the grpc service handles multiple clients streaming at the same time.

I assume that streaming events will collide meaning client 1 starts uploading an image, the grpc server gets the events and starts saving the image to file. Then client 2 starts uploading and client 2's upload requests will be mixed in with client 1's upload requests. 

How do you handle out of order uploads on the server so that the image data does not get mixed up with the wrong file?

Also while streaming can a single clients requests come in out of order too?

Josh Humphries

unread,
Aug 5, 2018, 12:57:28 PM8/5/18
to tycz...@gmail.com, grpc.io
Streams from multiple clients do not get intermingled. The server handler is invoked for each stream, and the handler gets a reference to the stream, for consuming events from just that one client.

Also, a single client's requests always arrive in order. gRPC is built on top of TCP, which handles reliable delivery and ordering of network packets.

----
Josh Humphries
jh...@bluegosling.com



--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/72da92e3-09ea-4db9-9ff4-3f2aa21428bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages