Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Windows operating system #183

Open
Slavix72 opened this issue Nov 25, 2019 · 2 comments
Open

Add support for Windows operating system #183

Slavix72 opened this issue Nov 25, 2019 · 2 comments

Comments

@Slavix72
Copy link

Python 3.8
Win 7
naz - 0.7.3 (last)
I created simple c;lient. When it connects to smsc with wrong IP/port (or link to smsc is lost), after 30 we can see

Traceback (most recent call last):
File "E:\py38\lib\site-packages\naz\client.py", line 810, in connect
reader, writer = await asyncio.open_connection(self.smsc_host, self.smsc_port)
File "C:\Users\S1\AppData\Local\Programs\Python\Python38\lib\asyncio\streams.py", line 52, in open_connection
transport, _ = await loop.create_connection(
File "C:\Users\S1\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1017, in create_connection
raise exceptions[0]
File "C:\Users\S1\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1002, in create_connection
sock = await self._connect_sock(
File "C:\Users\S1\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 916, in _connect_sock
await self.sock_connect(sock, address)
File "C:\Users\S1\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 702, in sock_connect
return await self._proactor.connect(sock, address)
File "C:\Users\S1\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 808, in _poll
value = callback(transferred, key, ov)
File "C:\Users\S1\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 595, in finish_connect
ov.getresult()
OSError: [WinError 121]The semaphore timeout period has expired
{'timestamp': '2019-11-25 20:26:56,332', 'event': 'naz.Client.re_establish_conn_bind', 'stage': 'end', 'smpp_command': '', 'log_id': '', 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}
{'timestamp': '2019-11-25 20:26:56,332', 'event': 'naz.Client.receive_data', 'stage': 'start', 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}
{'timestamp': '2019-11-25 20:26:56,332', 'event': 'naz.Client.receive_data', 'stage': 'end', 'state': 'naz is yet to bind to SMSC. sleeping for 30.00 seconds', 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}
{'timestamp': '2019-11-25 20:27:17,317', 'event': 'naz.Client.dequeue_messages', 'stage': 'start', 'current_session_state': 'CLOSED', 'state': 'awaiting naz to change session state to BOUND_TRX. sleeping for 30.00 seconds', 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}
{'timestamp': '2019-11-25 20:27:26,334', 'event': 'naz.Client.re_establish_conn_bind', 'stage': 'start', 'smpp_command': '', 'log_id': '', 'connection_lost': True, 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}
{'timestamp': '2019-11-25 20:27:26,334', 'event': 'naz.Client.connect', 'stage': 'start', 'log_id': '3krclixz65nx84bkl', 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}
{'timestamp': '2019-11-25 20:27:47,319', 'event': 'naz.Client.dequeue_messages', 'stage': 'start', 'current_session_state': 'CLOSED', 'state': 'awaiting naz to change session state to BOUND_TRX. sleeping for 30.00 seconds', 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}
{'timestamp': '2019-11-25 20:27:47,338', 'event': 'naz.Client.connect', 'stage': 'end', 'log_id': '3krclixz65nx84bkl', 'error': '[WinError 121] The semaphore timeout period has expired', 'smsc_host': '192.168.143.11', 'system_id': '16500', 'client_id': '6ULXO718UHTS64NC6', 'pid': 8120}

But, when link to smsc is up, client is connect to it succecfully.
How to fix bug with exception?

@komuw
Copy link
Owner

komuw commented Nov 25, 2019

naz has not been tested on windows, we only run the test suite on linux;

runs-on: ubuntu-18.04

you are going to have better luck if you try out naz on linux

@Slavix72
Copy link
Author

ok. I will test it under ubuntu 18.04 and python 3.8.0

@komuw komuw changed the title [WinError 121 - how to fix it? Add support for Windows operating system Dec 6, 2019
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

No branches or pull requests

2 participants