Solution to my read problem 'Broken pipe' 'write_socket_data'

MCCALL,DON (HP-USA,ex1) don_mccall at
Tue Mar 6 04:13:19 GMT 2001

Hi Lei,
I had a similar problem on a port of 2.07 (and 2.2) to MPE/iX os.  The
maximum amount of data that the sockets implementation on MPE/iX could
handle was 30,000, so I had to 'throttle' the write_socket_data() and
read_socket_data() for only 30,000 bytes at a time.
for read_socket_data()
#ifdef mpeix
      if (N - total > 30000)
        ret = read(fd,buffer + total,30000);
#endif /* mpeix */
and for write_socket-data()
#ifdef mpeix
      if (N - total > 30000)
re      ret = send(fd,buffer + total,30000,0);
#endif /* mpeix */
  But I think this was an MPE/iX os specific problem, as I have never seen
the need for this on HP-UX...

Thanks for the tip!

-----Original Message-----
From: Lei Zhang [mailto:lzhang at]
Sent: Monday, March 05, 2001 22:18
To: samba at
Cc: Dany; David Rankin
Subject: Solution to my read problem 'Broken pipe' 'write_socket_data'


The only reason I use Samba is I want to connect my linux desktop with
my windows laptop and share the larger disk with the laptop. I got weird

problem that I could only write to the samba server but I could not read

from it with errors like:

[2001/03/04 16:36:38, 0] lib/util_sock.c:write_socket_data(540)
  write_socket_data: write failure. Error = Broken pipe
[2001/03/04 16:36:38, 6] lib/util_sock.c:write_socket(563)
  write_socket(10,61503) wrote -1
[2001/03/04 16:36:38, 0] lib/util_sock.c:write_socket(566)
  write_socket: Error writing 61503 bytes to socket 10: ERRNO = Broken
[2001/03/04 16:36:38, 0] lib/util_sock.c:send_smb(754)
  Error writing 61503 bytes to client. -1. Exiting

I tried some suggestions on name resolution but it did not work. I had
intranet  before which the name was totally controlled by my linux box,
so I doubted this was not the real reason for me. I finally recognized
it was problem with socket(mighte be obvious from the log, but who knows

it was the socket itself caused the problem) Actually I ran win98/w2k
using vmware and connected them to linux by host-only virtual network
and there was no problem on these two systems, and there was only read
problem, no write problem on the real network-linked windows system. I
reviewed the code, and it seemed to me that the reason for 'Broken pipe'

was from 'send' function called by write_socket_data, then I read
smb.conf, and I came across the following lines:

# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
# Rather, the options do NOT work in some cases
   socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

After several trials, I modified the socket options to:

 socket options = TCP_NODELAY SO_RCVBUF=8192
ie, simply deleted the SO_SNDBUF=8192

Then, everything works perfectly now!

I suggest that if anyone meets such 'write_sock_data', 'Broke pipe', etc

errors, try something on this command first, or use different network
interface to see if errors occur in that case.

with regards


To unsubscribe from this list go to the following URL and read the

More information about the samba mailing list