How does my application figure out if connecting to server failed? #2116
-
| 
         For the synchronous TCP client, whenever "connect()" fails, it prints a message to the console and that's it. This isn't behaviour I would like to see from a library, I would rather it raised an exception or in some other way indicated failure to the caller, so the caller could handle it. Is it possible to configure this behaviour somehow?  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
| 
         No currently not, mainly due to the reconnect feature. I think if you disable the reconnect feature, then you get an exception.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Apart from that if you want a different behavior then pull requests are welcome.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         But connect() returns and if nothing else you can always check with connected(; if a connection is active.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Ah, that makes sense. Thanks for the quick replies!  | 
  
Beta Was this translation helpful? Give feedback.
But connect() returns and if nothing else you can always check with connected(; if a connection is active.