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
|