[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Network write() stalls with 'Resource temporarily unavailable'
>
> Hi all,
>
> I'm trying to communicate with a number of different remote nodes that
> may respond slightly slower than my program is trying to send each of
> them packets.
>
[trace deleted]
>
> In the code, I receive the request, decode it, then send the data
> (using write()) followed by the status.
>
> I'm finding that sometimes I'm getting the following:
>
> DBG: DECnet Connect : COMPAQ : FD : 8
> DBG: RdPkt : FD : 8 : Size 976/36 : OK (size = max/actual)
> DBG: WrPkt : FD : 8 : Size 108/108 : OK (size = req/actual)
> DBG: WrPkt : FD : 8 : Size 20/-1 : FAIL - Resource temporarily
> unavailable
>
If thats all you've sent, you certainly haven't exhausted the buffer...
> I have potentially a number of these clients connecting and requesting
> data, so I don't want to stall waiting for the resource to become
> available for that one connection (which appears to coincide with the
> data ack from the client for that data block ... if I slow it down a bit
> it works!), as I'll then stall the entire server.
>
> Normally, I don't need to send more than one packet back in response to
> a request, but occasionally it happens ... more likely for multiple
> requests to come in ...
>
> OK, the questions:
>
> (a) Shouldn't I be able to send multiple packets to a client without
> waiting for the ack to each packet?
>
Yes, that should all be taken care of transparently.
> (b) How big is the outbound buffer? Am I actually stalling while the
> outbound packet is being sent ?? If so, how do I make the outbound data
> buffer bigger, and would that make a difference?
>
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".
> (c) What *exactly* does 'Resource temporarily unavailable' mean in this
> context ??!
>
>
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 ?
Steve.
-----------------------------------------------------------------------------
To unsubscribe from this list, send a mail to majordomo@dreamtime.org
containing the line "unsubscribe linux-decnet"
-----------------------------------------------------------------------------