state-threads
[Top] [All Lists]

Re: st_netfd_poll returns within the requested timeout with timed out e

To: state-threads@xxxxxxxxxxx
Subject: Re: st_netfd_poll returns within the requested timeout with timed out error
From: Gene Shekhtman <gsh@xxxxxxxxxx>
Date: Tue, 25 Sep 2001 12:05:45 -0700
Organization: Abeona Networks, Inc.
References: <01092411323403.07213@bergsee.bio.uva.nl> <3BB0744B.DC97A6D3@level8.com>
Sender: owner-state-threads@xxxxxxxxxxx
Gregory Nicholls wrote:

>     Hi,
>       I've had a bit of a look at the st_write() code and to me it looks 
> bogus.
> If we complete a partial write and then timeout, we return -1. This doesn't 
> give
> the caller any chance to update their data pointers and re-issue the call. In
> fact they have no idea whether data has been sent or not (the doc on 
> st_write()
> confirms that this was the desired behaviour).

Indeed, it's a desired behavior.  It's all or nothing.  All ST's I/O functions 
have
the same semantics:  if connection was inactive for a specified amount of time,
return -1.


> I'd prefer that we return the
> number of bytes written and leave it to the caller to check whether the 
> operation
> completed successfully.

Nothing prevents you from writing your own custom function my_st_write() which
does exactly what you want.  All you need from ST is st_netfd_poll() which is a
public function.

--Gene



<Prev in Thread] Current Thread [Next in Thread>