Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

last 4 bits of incoming pdu is truncated on purpose? #150

Answered by eigenein
Wahib13 asked this question in Q&A
Discussion options

so I was testing receiving deliver_sm as a client and noticed a custom parameter I had introduced had the last 4 characters missing always. and I came across this line in the client.py code:
raw_pdu = self._socket.recv(length - 4)

I have updated it to
raw_pdu = self._socket.recv(length)
and now the full parameter data is received alright. but does anyone know why it was there in the first place? I don't want to launch and have problems later.
or if it is okay like this then I will leave it like that.

You must be logged in to vote

Hi @Wahib13,

length includes the length field itself, which is 4 bytes. So that the length field is already read, we have to read the rest length - 4 bytes.

Replies: 2 comments

Comment options

Hi @Wahib13,

length includes the length field itself, which is 4 bytes. So that the length field is already read, we have to read the rest length - 4 bytes.

You must be logged in to vote
0 replies
Answer selected by eigenein
Comment options

okay will run some more tests on Monday to confirm. thanks for the reply

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #66 on July 05, 2021 13:07.

AltStyle によって変換されたページ (->オリジナル) /