3 ms·
So, the library received some data. It also received an RST. It should store both pieces of information in the connection handle (library data structure). The
by jstimpfle 5y ago
So, the library received some data. It also received an RST. It should store both pieces of information in the connection handle (library data structure).
The caller can then inspect the state and decide what to do.
There are other options. The library could for example throw an exception and never report the received data. It's a different paradigm - making choices to present a convenient API that works in the common cases, at the cost of taking away control over the less common ones. APIs like this are popular and maybe useful for scripting languages, but probably less useful in larger systems.