Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Nov 2007 23:00:21 +0100
From:      Laszlo Nagy <gandalf@shopzeus.com>
To:        Bram <bram@diomedia.be>,  freebsd-questions@freebsd.org
Subject:   Re: TCP/IP questions
Message-ID:  <473386F5.5060403@shopzeus.com>
In-Reply-To: <47333C1A.7070709@diomedia.be>
References:  <4731E1A4.6020809@diomedia.be>	<200711081408.22387.nvass@teledomenet.gr> <47333C1A.7070709@diomedia.be>

next in thread | previous in thread | raw e-mail | index | archive | help
Bram wrote:
> Nikos Vassiliadis schreef:
>> On Wednesday 07 November 2007 18:02:44 Bram wrote:
>>  
>>> Hi all,
>>>
>>> Can you change the timeout for a tcp connection ?
>>> I need to do the following: start a tcp connection , unplug the network
>>> cable (it's actually wifi but the effect is the same),send some data
>>> over the connection,wait 20 seconds , reinsert the network cable and
>>> just keep working.
>>> When you normally do this the connection will be dead.
>>> Is there a way in freebsd to change this ? are there parameters wich 
>>> you
>>> can set so that the above would work (20 seconds without network can
>>> happen) ?
>>>     
>>
>> TCP using the default FreeBSD settings, can survive
>> 20 secs of inactivity. It can be an application forced
>> timeout. What application/protocol are talking about?
>>
>> Nikos
>>   
> This is the more full explanation:
>
> I have setup a mobile pc to roam across our building.
> By reducing the dwell time and changing the channel list to only the 
> channels I use roaming now works within ten seconds en sometimes 
> within one or two seconds.
> The previous configuration was with fedora and there I was unable to 
> get roaming time under 25 seconds.
>
> I do have one very annoying problem however and I have no idea how to 
> solve it.
> The software uses psycopg (a python postgresql module) wich uses the 
> standard system parameters for connections (At least that is what I 
> think).
> -On fedora if the connection gets lost and it takes 30 seconds to 
> remake a new connection operation is not interupted, after the 30 
> seconds you get the data you've been waiting for.
> -On freebsd however we get it a lot that the connection is "lost", you 
> can easily start a new connection wich works fine, but the old 
> connection you wore using stops working and the app. hangs (If I had 
> to guess I would say that roaming works about 95% of the time and the 
> connection is lost about 5% of the time).
>
> I also get a lot of IFDOWN IFUP messages but this seems normal to me.
>
> I am now going to program something in twisted using udp to see if 
> this works better.
>
Did you try to use some RPC library? You can have the psycopg connection 
on the server side, and use it through an object broker. You will 
probably find an object broker that can even survive a TCP reconnect. 
Then you do not need to rewrite the whole program.

Well, it is just an idea, may not be applicable for you.

Regards,

   Laszlo




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?473386F5.5060403>