-
Pre 1.0.0, it was clear that the high level Client could be created once and reused via the construction methods. Intuitively, I can tell that it's only going to allocate one outbound port to make requests on. With the new model/examples Do I need to be concerned about port exhaustion if I reuse the example client code verbatim? Also, in the example tokio::spawn is used to poll the connection. Does the polling exit after a set time or when the response from send_request is dropped? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
After doing some research on the matter, I've come to the conclusion that port exhaustion could occur, however by using TcpStream this is probably less likely due to the way mio and the os are creating sockets underneath the hood. For an added layer of safety/introspection, I've decided putting a semaphore (w/ about 400 permits) in the call path is probably the best way to apply a sanity check. |
Beta Was this translation helpful? Give feedback.
After doing some research on the matter, I've come to the conclusion that port exhaustion could occur, however by using TcpStream this is probably less likely due to the way mio and the os are creating sockets underneath the hood.
For an added layer of safety/introspection, I've decided putting a semaphore (w/ about 400 permits) in the call path is probably the best way to apply a sanity check.