The HyperNews Linux KHG Discussion Pages

## How to make sockets work whilst my process is in kernel mode?

  Forum: The Linux Kernel Hackers' Guide
  Keywords: socket, kernel
  Date: Fri, 23 Jan 1998 14:10:05 GMT
  From: Mikhail Kourinny <misio@kurin.kharkov.ua>

Hi all, I've written a kernel module that communicates with a remote device via TCP. It works fine while data is passed at less than ~4K per write. Otherwise I receive a "Broken pipe" mistake :( Looks like kernel internal buffers are not being empied while I'm in kernel mode. I tried setsockopt(TCP_NODELAY), sleeping { current->state = INTERRUPTIBLE; current->timeout = jiffies + 10; schedule();} with no success. GODS! Where is my mistake? How should I make sockets to work? I'd be happy being pointed to some TFM :) There should be probably less tricky ways to solve my problem, but I just wish to complete this approach. Thanks in advance, Mikhail