komuw / naz

naz is an async SMPP client.
https://komuw.github.io/naz/
MIT License
39 stars 12 forks source link

connection to smsc with double tcp sesion? #192

Closed Slavix72 closed 4 years ago

Slavix72 commented 4 years ago

Python 3.7 Naz 0.7.4 socket_timeout = 30.0

Client performs connection to smsc... double Are packets 1 and 4 establish 2 tcp-sessions? And bind_transceiver is sent across second session on 30 seconds after starting...

komuw commented 4 years ago

What is happening here is;

So, it would be good to have tranceiver_bind() coroutine wait for the connect() coroutine to finish first before running. But the implementation to do that would be overkill and I do not think the effort is worth the gain

komuw commented 4 years ago

How long does naz wait before sending another bind request? currently naz waits for a duration equal to naz.Client.socket_timeout. By default socket_timeout is 30seconds.

Do note that this is an implementation detail and is likely to change. ie, users should not rely on this behaviour.

Slavix72 commented 4 years ago
  1. Why can not to use the first TCP-session (after 30 sec)?
  2. Why is impoissible to kill unused TCP-session ?
Slavix72 commented 4 years ago

The first (simplest, but not beautiful) step is remove client.connect() and client.tranceiver_bind() tasks = asyncio.gather(

client.connect(),

#client.tranceiver_bind(),
client.dequeue_messages(),
client.receive_data(),
client.enquire_link()

) re_establish_conn_bind() can perform tcp-connection and bind_transciever......

komuw commented 4 years ago

I do not consider this to be a major problem that needs to be solved. It is an annoyance, but an annoyance that I'm happy to live with.

Unless it turns out that there is a serious bug hiding somewhere underneath, I'm going to close this issue.