Disabling a Linux TCP/IP Socket

This is a discussion on Disabling a Linux TCP/IP Socket within the Linux Networking forums, part of the Linux Forums category; Hi All, We are working on a application which will offload some of the tcp/ip connections after the setup ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-10-2004
B.Ravi Kumar
 
Posts: n/a
Default Disabling a Linux TCP/IP Socket

Hi All,

We are working on a application which will offload some of the
tcp/ip connections after the setup completes. For this purpose, we
want to keep the socket in suspended state till we hand back the
control to socket. For this I tried to do the following:
1. In the user space established the connection and send the socket
file descriper to a kernel module.
2. In the kernel module we got the handle to sock structure by
sock_lookup call.
3. In the sock structure, we made the state to TCP_LISTEN from
ESTABLISHED as in LISTEN state the tcp socket can stay alive
indefinitely.

But doing this makes the whole sytem to hang. Can some one please help
me to know
* How to do the above?
* How to disable TCP timers for a given socket effectively making
the socket to sleep until woken up.

thanks and regards,
Ravi
Reply With Quote
  #2 (permalink)  
Old 06-10-2004
Cameron Kerr
 
Posts: n/a
Default Re: Disabling a Linux TCP/IP Socket

B.Ravi Kumar <rabh@indiatimes.com> wrote:

> We are working on a application which will offload some of the
> tcp/ip connections after the setup completes.


What `setup'?

> For this I tried to do the following:


Ewww, that is a truly hideous way to do that. Anyway, what would the
other end of the connection think? It's going to timing out. The only
way to effectively sleep a connection is to accept the connection,
enable keepalives, and not read/write to it. But even then you can fall
fowl of the connection peer if it expects to read/write but times out
waiting to send or recieve on the socket.

Sounds like you need something like simpleproxy or redir.

Package: simpleproxy
Description: Simple TCP proxy
simpleproxy acts as a simple TCP proxy. It opens a listening socket on
the local machine and forwards any connection to a remote host. It can be
run as a daemon or through inetd.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:35 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0