hei,
I have got the impression that by using the T_MORE bit, the message
boundry can be conveyed from sender to receiver. I send 5100, say,
(t_send("5100 bytes")).
Then these bytes will arrive in one or more packets to the receiving
program. If more than one packet is used, the T_MORE-bit will be set
until all bytes have been read (bmo t_rcv()). The last t_rcv() return
T_MORE == 0.
I am on SunOS 4.1.1
I tried sending 5100 bytes and got the following t_rcv() sequence,
reading max 500 bytes for each t_rcv() (flags=1 means T_MORE==1):
Sender and receiver on the same machine.
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 96 bytes flags=0
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 4 bytes flags=0
Next test (sender and receiver on different machines, but still sun's):
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 460 bytes flags=0
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 460 bytes flags=0
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 176 bytes flags=0
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 500 bytes flags=1
CLIENT: t_rcv ok... 4 bytes flags=0
t_getinfo() returns the following:
CLIENT: size of protocol address: 16
CLIENT: size of protocol options: 0
CLIENT: size of max transport service data unit: 0
CLIENT: size of max expedited tsdu: 1
CLIENT: max data for connection primitives: -2
CLIENT: max data for disconnect primitives: -2
CLIENT: provider service type: 1
CLIENT: size of protocol address: 16
CLIENT: size of protocol options: 0
CLIENT: size of max transport service data unit: 0
CLIENT: size of max expedited tsdu: 1
CLIENT: max data for connection primitives: -2
CLIENT: max data for disconnect primitives: -2
CLIENT: provider service type: 1
where 'size of max transport service data unit: 0' should mean that
T_MORE is not used, but it is (PARTLY).
Why is the T_MORE == 0 before all the 5100 bytes have been read.
Buffer sizes?? Bug?? any options I must set??
Does a stream have a notion of messageboundries at all?
To be able to extract a message, do u actually have to put information
about the messagelength inside the message itself, so the reader can
know how much to actually read?
Thank you,
b(aring)rd.
--
++ Bard W. Torustad, Telenor Research and development
++ PO Box 158, N-2601 Lillehammer, Norway
++ Phone: +47 61 26 84 20 Fax: +47 61 26 84 40