From owner-state-threads@oss.sgi.com Mon Sep 24 02:39:09 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id f8O9d9726711 for state-threads-outgoing; Mon, 24 Sep 2001 02:39:09 -0700 Received: from mail.science.uva.nl (mail.science.uva.nl [146.50.4.51]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id f8O9d5e26708 for ; Mon, 24 Sep 2001 02:39:05 -0700 Received: from bergsee.bio.uva.nl [145.18.171.114] by mail.science.uva.nl with SMTP (sendmail 8.11.4/config 11.16). id f8O9cAo25213; Mon, 24 Sep 2001 11:38:10 +0200 (MEST) X-Organisation: Faculty of Science, University of Amsterdam, The Netherlands X-URL: http://www.science.uva.nl/ Content-Type: text/plain; charset="iso-8859-1" From: John Val To: state-threads@oss.sgi.com Date: Mon, 24 Sep 2001 11:33:26 +0200 X-Mailer: KMail [version 1.2] MIME-Version: 1.0 Message-Id: <01092411323403.07213@bergsee.bio.uva.nl> Content-Transfer-Encoding: 8bit Subject: st_netfd_poll returns within the requested timeout with timed out error Sender: owner-state-threads@oss.sgi.com Precedence: bulk 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@science.uva.nl E-mail: j.val@hccnet.nl (personal) home: http://home.hccnet.nl/j.val From owner-state-threads@oss.sgi.com Tue Sep 25 05:03:40 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id f8PC3ep23413 for state-threads-outgoing; Tue, 25 Sep 2001 05:03:40 -0700 Received: from corpmail.level8.com ([207.124.41.30]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id f8PC3ZD23406 for ; Tue, 25 Sep 2001 05:03:35 -0700 Received: from level8.com (adsl-156-210-147.bct.bellsouth.net [66.156.210.147]) by corpmail.level8.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id TJQLM08J; Tue, 25 Sep 2001 08:04:59 -0400 Message-ID: <3BB0744B.DC97A6D3@level8.com> Date: Tue, 25 Sep 2001 08:10:51 -0400 From: Gregory Nicholls X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 CC: state-threads@oss.sgi.com Subject: Re: st_netfd_poll returns within the requested timeout with timed out error References: <01092411323403.07213@bergsee.bio.uva.nl> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-state-threads@oss.sgi.com Precedence: bulk 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). I'd prefer that we return the number of bytes written and leave it to the caller to check whether the operation completed successfully. Comments ?? G. 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@science.uva.nl > E-mail: j.val@hccnet.nl (personal) > home: http://home.hccnet.nl/j.val From owner-state-threads@oss.sgi.com Tue Sep 25 12:05:47 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.2/8.11.3) id f8PJ5lK32537 for state-threads-outgoing; Tue, 25 Sep 2001 12:05:47 -0700 Received: from mail.abeona.com ([209.81.58.10]) by oss.sgi.com (8.11.2/8.11.3) with SMTP id f8PJ5iD32534 for ; Tue, 25 Sep 2001 12:05:44 -0700 Received: from abeona.com (IDENT:gsh@concord [192.168.1.56]) by mail.abeona.com (8.9.3/8.9.3) with ESMTP id MAA31135 for ; Tue, 25 Sep 2001 12:01:14 -0700 Message-ID: <3BB0D589.793C9033@abeona.com> Date: Tue, 25 Sep 2001 12:05:45 -0700 From: Gene Shekhtman Organization: Abeona Networks, Inc. X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: state-threads@oss.sgi.com Subject: Re: st_netfd_poll returns within the requested timeout with timed out error References: <01092411323403.07213@bergsee.bio.uva.nl> <3BB0744B.DC97A6D3@level8.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-state-threads@oss.sgi.com Precedence: bulk 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