Thanks. I'm learning your thread https://groups.google.com/g/grpc-io/c/bXMmfah57h4/m/EUg2B8o1AgAJ.
And i think server handle all new connections in 'on_read' function (inside src/core/lib/iomgr/tcp_server_posix.cc). For each connection, server create a fd for it (so one connection bind with one fd), and inside pollset_work (src/core/lib/iomgr/ev_epollex_linux.cc), the pollset of the CQ will epoll_wait all of the fds. I think I have to pass the (connection, fd) pairs to CQ. Right now, the problem is that inside *Finsh* and *FinalizeResult*, I only have 'tag' (I guess due to some encapsulation reasons, grpc hide low level information here), I didn't have any hint to locate which connection/fd from this 'tag'. I think grpc have some record to pair this 'tag' with connection. And if one client send multiple requests, each request has its own 'tag', but grpc will find the connection/fd from these tags. So I think I have to find this 'tag' - connection map inside grpc. But not find yet. Please correct me if i'm wrong. Thanks for any ideas or suggestions. 在2021年11月22日星期一 UTC-5 13:56:15<[email protected]> 写道: > On Friday, November 19, 2021 at 3:07:02 PM UTC-8 [email protected] wrote: > > > If i use one completion queue in server side to handle all of the > > connections, for each return from cq.AsyncNext, how do i know which > > connection it is. > > You will need to augment CallData with these sort of details. You will also > need multiple instances of CallData at once, one per "in flight" > gRPC operation. > > In an older thread on a similar topic, "How to implement async gRPC with > more than one method?", [1] I provided an architectural sketch of one way > to > make this work. See if that helps. > > [1]: https://groups.google.com/g/grpc-io/c/bXMmfah57h4/m/EUg2B8o1AgAJ > > -- > Christopher Warrington > Microsoft Corp. -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/07672c90-944f-42cf-a655-24faccff73den%40googlegroups.com.
