Networking Forums

Networking Forums > Computer Networking > Linux Networking > Disabling a Linux TCP/IP Socket

Reply
Thread Tools Display Modes

Disabling a Linux TCP/IP Socket

 
 
B.Ravi Kumar
Guest
Posts: n/a

 
      06-10-2004, 08:39 AM
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
 
 
 
 
Cameron Kerr
Guest
Posts: n/a

 
      06-10-2004, 07:01 PM
B.Ravi Kumar <(E-Mail Removed)> 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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does Linux and embedded Linux provides RAW socket? GS Linux Networking 3 04-14-2007 05:26 AM
Linux kernel socket programming Shuang Liang Linux Networking 2 04-07-2005 12:38 AM
Linux (RH8) Socket Timeouts Otto Blomqvist Linux Networking 1 09-20-2004 01:37 PM
Linux Socket Problem? LaBird Linux Networking 2 02-23-2004 07:04 AM
linux socket programming sank Linux Networking 2 01-02-2004 05:36 PM



1 2 3 4 5 6 7 8 9 10 11