Skip to content

Conversation

@rnestler
Copy link
Contributor

Based on #1181

@oroulet
Copy link
Member

oroulet commented Jan 22, 2023

need rebase too

@rnestler rnestler force-pushed the only-log-when-limits-changed branch from 57aff7e to e78417e Compare December 26, 2023 15:17
@rnestler rnestler marked this pull request as ready for review December 26, 2023 15:17
@rnestler
Copy link
Contributor Author

@oroulet Rebased.

@rnestler rnestler force-pushed the only-log-when-limits-changed branch from 7b480a6 to 00bf33a Compare December 26, 2023 16:18
Comment on lines +56 to +64
max_recv_buffer = ack.ReceiveBufferSize if role == "client" else ack.SendBufferSize
max_send_buffer = ack.SendBufferSize if role == "client" else ack.ReceiveBufferSize

new_limits = TransportLimits(
max_chunk_count=ack.MaxChunkCount,
max_recv_buffer=max_recv_buffer,
max_send_buffer=max_send_buffer,
max_message_size=ack.MaxMessageSize,
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now not sure if it makes sense to create the new_limits here or if we should keep this in the other methods, since it differs between client and server.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry That MR disapeard into the backlog.. but yes inline would be better I think

_logger.error("Number of message chunks: %s is > configured max chunk count: %s", sz, self.max_chunk_count)
return within_limit

def _set_new_limits_from_ack(self, ack: ua.Acknowledge, role: Literal["client", "server"]) -> None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you really need that Role, it should be an enum.
But in that case I would jsut create two methods, one for server and one for client. That is simpler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants