JSC-ER7 (hadi.m.tjandrasa1++at++jsc.nasa.gov)
Mon, 11 Aug 1997 09:05:00 -0500
TCP/IP may not guarantee that the READ will return the length specified.
You need to read until the specified length is received. Note that the
next message from the writer may appear appended to the previous
message; so you need to devise a mechanism for this and also make sure
not looping in reading without some guard/checking/timeout. If you do
not have header on the message, it is a good practice to have your own
header message.
If only for chasis-to-chasis, UDP may be preferable for real-time
application although it's a bit more complex than TCP/IP.
Hadi Tjandrasa
>----------
>From: Sam Chu[SMTP:c00chu00++at++nchc.gov.tw]
>Sent: Saturday, August 09, 1997 2:29 AM
>To: info-performer++at++sgi.com
>Subject: problems for TCP/IP read
>
>
>Hi performers:
>
> thought this is a communicatin problem, I think lots of simulation
>progrmmers already have this question and may know how to solve it.
>
>I try to do the inter-Chassis communication and use the
>socket communication codes from examples - "accept and
>connect" under directory "/usr/people/4Dgifts/examples/network"
>but the "read" command not always read the size which I specify
>in "read(sock, data, size)". Is there any way I can ask "read" always
>to read size of data?
>
>Sam Chu
>National Center for High-Performance Computing
>Scientific Visualization Lab Email: c00chu00++at++nchc.gov.tw
>Tel: (886)35-776085 Ext 248 Fax : (886)35-773538
>=======================================================================
>List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:43 PDT