I have an application which opens a socket connection to a HP 4250N printer on port 9100
If unable to open a connection it tries every 30 seconds for up to 10 minutes.
Sometimes the connection attempt returns "Connection refused", but eventually the connection is successful.
Nothing else is printing at the time
Why would connection be refused for several minutes but then be successful? Is there a timeout that tidies up previously disconnected connections or incomplete jobs after a while?