Open AdamMagaluk opened 8 years ago
two months later, same pb. I am considering using
var agent = spdy.createAgent({
...
});
//intuition: once agent is connected, connection is not null but a proper object
agent.on('_connect', function(){
//we should not be doing this as _spdyState is meant to be an internal to the library...
agent._spdyState.connection.on('close', function(){
console.log('closed connection');
})
})
I'm using
spdy.createAgent
method to create a http agent that im reusing for a number of outbound http requests to a server. This is working great but i can't figure out how to handle cases when the tcp connection to the server disconnects after it's been established so i can reconnect and start over.I can only seem to get the
error
event on the agent to fire if i start the client when the server if already down. If i start the client with a working server then disconnect the server the client will continue to try and make requests without any errors from either the agent or client request.Any suggestions?
See example: