frx
frx

Reputation: 492

Finagle client handle onConnected event

I'm trying to build async client for some tcp service. Service requires handshake. When initial connection is established I can make handshake, but if connection fails and finagle reconnects i have no way to make handshake again. Is there a way to catch connected event? Thank You!

Upvotes: 0

Views: 180

Answers (1)

Steve Gury
Steve Gury

Reputation: 15668

You can override the method prepareConnFactory in your codec. Basically each time finagle establishes a connection it will execute this method before putting the connection into the queue.

We use this feature in the ThriftClientFramedCodec to verify that the server is compatible with our custom thrift protocol.

Upvotes: 2

Related Questions