[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Network write() stalls with 'Resource temporarily unavailable'



> This is settable via a sysctl and is the same for all the socket families.
> It defaults to 32k or 64k according to the CONFIG_SKB_LARGE option. I
> don't think that this is the problem though. DECnet has its own internal
> checks which mean that to start with only one packet is allowed to be
> outstanding, unacknowledged. As the connection goes on, this is relaxed,
> but it tightened up if a packet is lost. Its the standard BSD TCP
> algorithms which I "borrowed".

That would explain it ...

> I'm wondering if it is EWOULDBLOCK by a different name... You've not got a > non blocking socket by some chance ? What is the actual value of errno ?

Non-blocking, correct. 

errno = 11


If that's the problem, then what do you think of this as a solution:

write(fd, data, len)
if (EWOULDBLOCK) then
   pthread_create(do_blocking_write(),fd,data,len)
continue ...

void do_blocking_write()
  set_fd_blocking
  write(fd, data, len)
  set_fd_non_blocking
  return


An associated question : 

Lets say I block on the second packet, and spawn a new (blocking) thread
to take care of it, and I want to send another packet. If I spawn a
(blocking) thread to take care of this one, can I be certain that they
will complete in the order the write() functions took place ?


Rob.
-----------------------------------------------------------------------------
To unsubscribe from this list, send a mail to majordomo@dreamtime.org
containing the line "unsubscribe linux-decnet"
-----------------------------------------------------------------------------