iocontrol | Measure and throttle the rate at which data
kandi X-RAY | iocontrol Summary
kandi X-RAY | iocontrol Summary
Package iocontrol offers io.Writer and io.Reader implementations that allow one to measure and throttle the rate at which data is transferred.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of iocontrol
iocontrol Key Features
iocontrol Examples and Code Snippets
Community Discussions
Trending Discussions on iocontrol
QUESTION
I have an application that opens a read-only TCP stream socket. I have set up KeepAlive to ensure that every second a message is sent to check if the connection is still ok. Wireshark shows that the KeepAlive messages are sent and also ACKd by the other computer. My application is running on windows.
The remote machine to where I open the socket is on a separate LAN adapter compared to the rest of the network/internet.
There are two scenarios that seem to react in a different way, and I would like to know why.
- I am connected to the internet. TCP Keep-Alive is going strong every second. I pull the LAN cable from the machine. The last TCP Keep-Alive is not ACKd and therefore
Socket.Connected
isfalse
, as expected. - I am not connected to the internet. TCP Keep-Alive is going strong every second. I pull the LAN cable from the machine. No TCP Keep-Alive package was sent to the remote machine at all, therefore
Socket.Connected
is stilltrue
.
Am I missing an important concept here on when a TCP Keep-Alive package is sent by the socket? For example, don't send if you don't have a network connection at all? And if so, how can I ensure that the socket is no longer Connected
?
ANSWER
Answered 2021-Dec-02 at 11:38Socket is not aware of Internet Connetion availability but it's aware of Network Device state. It's just a very low-level TCP unit.
It can only send and receive something not diagnosing the network behind the network device. I didn't read the RFC but the behavior you're described is expected.
Keep-alive sill be sent periodically while TCP connetion is up.
therefore Socket.Connected is still true
Looks like a known TCP head-of-line problem. Socket is waiting for response till timeout occured to be closed.
Imagine the setup: you're in poor connection environment, some host is loosing packets or hang for seconds. Then if Socket will close the connection before timout only when not received the keep-alive ping, you'll get a closed connection. Keep-alive is intended to make the connection lifetime longer not shorter.
Also a tip:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install iocontrol
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page