Tux

...making Linux just a little more fun!

how to close connected/listening socket?

Mulyadi Santosa [mulyadi.santosa at gmail.com]


Sun, 18 Apr 2010 15:38:13 +0700

Hi all

Once I read there is a way to close a listening/half open/connected/etc TCP socket using Linux kernel facility i.e using one of /proc entries.

Do any of you recall which /proc (or /sys maybe?) entry that does the job?

Thanks in advance..

-- 
regards,
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com


Top    Back


Thomas Adam [thomas at xteddy.org]


Sun, 18 Apr 2010 10:53:42 +0100

On Sun, Apr 18, 2010 at 03:38:13PM +0700, Mulyadi Santosa wrote:

> Hi all
> 
> Once I read there is a way to close a listening/half
> open/connected/etc TCP socket using Linux kernel facility i.e using
> one of /proc entries.
> 
> Do any of you recall which /proc (or /sys maybe?) entry that does the job?

I don't think so. TIME_WAIT is usually involved with TCP sockets, which means the kernel will wait for that time before sending an ACK for terminating the socket.

In /proc, there is:

/proc/sys/net/ipv4/tcp_tw_recycle

Which controls the TIME_WAIT value. But changing this is not a good idea.

-- Thomas Adam

-- "It was the cruelest game I've ever played and it's played inside my head." -- "Hush The Warmth", Gorky's Zygotic Mynci.


Top    Back


Mulyadi Santosa [mulyadi.santosa at gmail.com]


Sun, 18 Apr 2010 21:30:25 +0700

Hi Thomas....

On Sun, Apr 18, 2010 at 16:53, Thomas Adam <thomas at xteddy.org> wrote:

> In /proc, there is:
>
> ``
> /proc/sys/net/ipv4/tcp_tw_recycle
> ''
>
> Which controls the TIME_WAIT value. ?But changing this is not a good idea.

Although it's not directly related to my question, I still thank you for this valuable info :)

Hmmm, now.... if only I could recall which /proc entry it is....

-- 
regards,
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com


Top    Back