Asynchronous call through single connection. How can Netty help me?

25 views
Skip to first unread message

Mark J. Greenberg

unread,
Nov 28, 2016, 9:04:52 AM11/28/16
to Netty discussions
Hi !

I need to write a client for asynchronous TCP/IP server. I will have only 1 connection open. I will send multiple requests to this Server. Server replies will be returned in random order. That is I send in example requests A, B, C, and Server returns responses B, C, A. So I will have to identify based on data contained in responses which response belong to which request. I can't block requests to wait for answer to be returned to first one, and then only send another one. On front I have webapp, so any user can trigger some request to be sent to this Server. But again I have only 1 connection and have to put all my calls to server through this connection.

I already have code that opens new connection each time for every new request I receive through my webapp but this will not do with the Server. How Netty can help me with this kind of "asynchronous-ness" ? Which classes I should look into? Can it help me with matching request to response as well?

I would appreciate any help. Thank you!
Reply all
Reply to author
Forward
0 new messages