Draegerwerk/sdc11073

consumer cannot handle providers that close the connection after each call

Closed this issue · 0 comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Consumer cannot determine own ip address if provider closed connection after first call.

Expected Behavior

Consumer can determine own ip address even if provider closed connection after first call.

Minimal Reproducible Example

No response

Solution proposal

The problem is that the own ip address is calculated after the first message is sent to the consumer.
This is done by callinf getsockname() of the connection socket. This fails if socket is already closed.
Proposal:
Add a member "sock_name" to SoapClient and set if when connecting:
self.sock_name = self._http_connection.sock.getsockname()

Set back to None when closing connection.

The underlying http client uses implicit connect, therefore this works if th provider closes connection after each call.

In consumerimpl.py use the sock_name member instead of calling getsockname()

Python Version

all

Operating system

all

Sdc11073 Version

2.0.0a6

Link to sdc11073 Logs

No response

Further Information

No response

Participation

  • I am willing to submit a pull request to fix this bug.