Thalius wrote:Code: Select all
# enable
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
# disable
echo 0 > /proc/sys/net/ipv4/tcp_syncookies
I do not seem to have a file
"/proc/sys/net/ipv4/tcp_syncookies"
on my machine.
(I could probably find an option for syncookies somewhere in the kernel configuration
and recompile my kernel with the changed settings, but I do not really like that idea
so much.)
Also, as far as I understood it, it should be an option for the server (not for the client).
Thalius wrote:as i see oyu want to connect to a HTTP Port - you might want to give this a try:
viewtopic.php?f=12&t=29388
originally pretty old source - but if this timeout method works for you ( here it does ) then thats leaner than using a thread
Thank you Thalius, I do have some coded infrastructure with similar functions allready.
(Except my focus is not on downloading files in this case.)
You catch the situation when the connect fails and treat it as a timeout:
Code: Select all
...
*this\ConID = OpenNetworkConnection( *this\Host , #HTTP_Port )
If *this\ConID
...
Else
;// Connection Timeout
PureHTTP_SET_STATUS(*this,#PureHTTP_STATUS_TIMEOUT)
EndIf
Depending on the usage, that could be true with some probability.
But you would still need to wait until OpenNetworkConnection() returns.
I did not see anything in your code that would shorten that timeout.
@walker: exactly, this is the approach, I have in mind.
This principle will work independent of platform (probably).
When I get to it again, I will probably do it that way,
also making shure, connections opened by the thread,
after my timeout are closed asap...
(As mentioned above)