question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Server-to-client streaming

See original GitHub issue

The spec says

In gRPC a client application can directly call methods on a server application on a different machine as if it was a local object, making it easier for you to create distributed applications and services.

I need to implement a flow where server calls a client method and waits for response. Caveat - I don’t want to use timeouts (Sleep/SpinWait) and can’t use TaskCompletionSource as synchronization primitive because system will be distributed and one cannot put TCS to Redis or some other distributed cache. I know this is not something that is currently implemented, but maybe it is planned or at least there are ideas how to tackle this problem? Thanks in advance for the response. p.s. Having both client and server on the each side of the conversation appears to be the solution, but it’s definitely not an efficient one.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kskalskicommented, Sep 19, 2019

Why not just use a stream where client connects (and keeps the call open) and then waits for a message from server (answering it and then waiting for next one)?

0reactions
philliphoffcommented, Jan 10, 2023

If I understood correctly you want the process that performed a TCP Connect to behave as a server and the process that performed the TCP Listen to behave a client. This is currently unsupported by by both Kestrel and HttpClient which makes it impossible for us to support it in this project. To achieve what you’re trying to do, I’d recommend using an existing TCP Tunneling solution.

We’ve had a similar question come up in the context of Dapr, in part as a mitigation for firewalls between application and Dapr sidecar (where, ideally, the gRPC API need not change into a streaming-based API). It’s been a couple years, does anyone know if this limitation still exists? (We’ve been able to achieve this scenario on the Go side, but now looking at .NET.)

@shirhatti @JamesNK

Read more comments on GitHub >

github_iconTop Results From Across the Web

Video streaming from client to server: which alternative use ...
Streaming video or audio with websocket is really simple but I can't found any experience about streaming client-server using webrtc. 2) What ...
Read more >
Client–Server Multimedia Streaming
In the client–server multimedia streaming, each client requests and obtains what it wants directly from the streaming server. Client–server based multimedia ...
Read more >
Basics tutorial | Go
A server-side streaming RPC where the client sends a request to the server and gets a stream to read a sequence of messages...
Read more >
What is HTTP Streaming?
HTTP Streaming is a push-style data transfer technique that allows a web server to continuously send data to a client over a single...
Read more >
Use streaming in ASP.NET Core SignalR
JavaScript clients call server-to-client streaming methods on hubs with connection.stream . The stream method accepts two arguments:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found