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). I'd prefer that we return the
number of bytes written and leave it to the caller to check whether the
John Val wrote:
> Dear state thread developpers/users,
> I am building an interactive client server application allowing for numerical
> analysis of dynamical dynamical systems. I am trying to use the state -
> thread library for this purpous.
> Currently I am running into problems with st_netfd_poll in as it looks
> st_write and st_read.
> During a computation I send the numerical results line after line to the
> client. Typically 1000 lines are send in one computation. On the client I
> noticed that some lines were not send correctly. I traked down the problem
> and noticed that if I write a line to the client such as
> st_write( clientfd, line, linelength, 1000000 );
> I sometimes get a time out error. Reasonable since I give a timeout, but
> unreasonable while the timeout never amountts to the 1 second I request.
> It seems st_netfd_poll returns immediately!!
> Who can help me out?
> I am developping using linux 2.4.3 on a pentium III system.
> Dr. John Val
> Population Biology section
> Instituut voor Biodiversiteit en Ecosysteem Dynamica
> Faculteit der Natuurwetenschappen, Wiskunde en Informatica
> University of Amsterdam
> Kruislaan 320
> 1098SM Amsterdam
> Telephone: () 31 20 5257768
> E-mail: val@xxxxxxxxxxxxxx
> E-mail: j.val@xxxxxxxxx (personal)
> home: http://home.hccnet.nl/j.val