Re: in over my head ascii



nephish@xxxxxxx wrote:
ok, i am stuck again.

from the docs, the byte stream is supposed to look like this:

'S' 'T' 'X' [length indicator] [message type] [message] 'E' 'N' 'X'

the length indicator it says is a four byte integer number of a value N
( N would be how long the message body is )

the message type comes from a table in the docs. In my case, the
message type is 200. This is also supposed to be sent as a 4 byte
value.

so..... how do i make 200 occupy 4 bytes ?


You use the struct module and make sure you specify the correct "endianness" - bet you didn't bargain for all this when you started!

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/

.



Relevant Pages

  • Re: JMS message type
    ... "A BytesMessage object's message body contains a stream of uninterpreted ... This message type is for literally encoding a body to match an existing ... May be they could make it deprecate in later ... The use case is where you want to send just raw bytes in the message. ...
    (comp.lang.java.programmer)
  • Re: JMS message type
    ... "A BytesMessage object's message body contains a stream of uninterpreted bytes. ... This message type is for literally encoding a body to match an existing message format. ... Although the JMS API allows the use of message properties with byte messages, they are typically not used, since the inclusion of properties may affect the format." ...
    (comp.lang.java.programmer)
  • Re: in over my head ascii
    ... ok, i am stuck again. ... the byte stream is supposed to look like this: ... the length indicator it says is a four byte integer number of a value N ... the message type comes from a table in the docs. ...
    (comp.lang.python)
  • Re: Attachment is not showing - Roady
    ... With what message type is this happening? ... Microsoft Office and Microsoft Office related News ... > attachment to another user but attachment icon is not ... > Best Regards ...
    (microsoft.public.outlook.general)