Module connecting outside

Antonio Nappa jeppojeps at gmail.com
Thu Mar 30 22:01:52 UTC 2017


Hello,

I have a module connecting to the outside through SSL with the usage of
ngx_event_connect_peer and the SSL primitives of nginx. My next question
is, it is better to have a separate peer and its connection for each
worker, or share the same connection among all the workers? My idea is to
send some information to the outside world and both ways may work, but I
want to be sure to make the correct design decision.

Thanks a lot,
Antonio

2017-03-21 14:57 GMT+01:00 Maxim Dounin <mdounin at mdounin.ru>:

> Hello!
>
> On Tue, Mar 21, 2017 at 02:42:01PM +0100, Antonio Nappa wrote:
>
> > By checking the ngx_http_upstream I don't see any kind of handling in
> case
> > the ngx_ssl_handshake returns NGX_ERROR, I am trying to catch this error
> in
> > order to handle network outages and subsequent reconnections attempts
> from
> > my module. Do you think this could be a good way to trigger reconnection
> > timer? At the moment I am handling reconnections also in the read and
> write
> > events when  if(wev->timedout || c->error || c->close).
>
> The ngx_http_upstream_ssl_handshake() function checks if
> c->ssl->handshaked is set.  If it's not, there was an error or a
> timeout.
>
> --
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20170331/fb976bbd/attachment.html>


More information about the nginx-devel mailing list