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

OSError: [WinError 10022] An invalid argument was supplied #52

Closed
2trc opened this issue Dec 7, 2016 · 2 comments
Closed

OSError: [WinError 10022] An invalid argument was supplied #52

2trc opened this issue Dec 7, 2016 · 2 comments

Comments

@2trc
Copy link

2trc commented Dec 7, 2016

Hi,
On windows I get this error while running the example fileserver.py or any other examples on http://aiocoap.readthedocs.io/en/latest/examples.html

Traceback (most recent call last):
  File "fileserver.py", line 173, in <module>
    loop.run_until_complete(main(**vars(p.parse_args())))
  File "c:\program files (x86)\python35-32\Lib\asyncio\base_events.py", line 387, in run_until_complete
    return future.result()
  File "c:\program files (x86)\python35-32\Lib\asyncio\futures.py", line 274, in result
    raise self._exception
  File "c:\program files (x86)\python35-32\Lib\asyncio\tasks.py", line 239, in _step
    result = coro.send(None)
  File "fileserver.py", line 161, in main
    context = await aiocoap.Context.create_server_context(server)
  File "C:\Users\eremtas\Documents\Projects\AppIoT\aiocoap-101\venv\lib\site-packages\aiocoap\protocol.py", line 535, in create_server_context
    transport, protocol = yield from loop.create_datagram_endpoint(protofact, family=socket.AF_INET6)
  File "c:\program files (x86)\python35-32\Lib\asyncio\base_events.py", line 848, in create_datagram_endpoint
    sock, protocol, r_addr, waiter)
  File "c:\program files (x86)\python35-32\Lib\asyncio\selector_events.py", line 90, in _make_datagram_transport
    address, waiter, extra)
  File "c:\program files (x86)\python35-32\Lib\asyncio\selector_events.py", line 997, in __init__
    super().__init__(loop, sock, protocol, extra)
  File "c:\program files (x86)\python35-32\Lib\asyncio\selector_events.py", line 514, in __init__
    self._extra['sockname'] = sock.getsockname()
OSError: [WinError 10022] An invalid argument was supplied
ERROR:asyncio:Task was destroyed but it is pending!
task: <Task pending coro=<FileServer.check_files_for_refreshes() running at fileserver.py:49> wait_for=<Future pending cb=[Task._wakeup()]>>

I don't get this error on Ubuntu. it could be something to do with asyncio

Remi

@chrysn
Copy link
Owner

chrysn commented Dec 7, 2016

@2trc, this looks largely like a duplicate of #27, but I'll leave it open because we might be able to work something out here – this is all a bit tricky for me to debug since I don't have any current Windows machines.

In #27 (comment), ksrm has suggested dropping the IPv6-related options and placing IPv4 addresses everywhere instead of v6 ones (not the way to go on the long run, but it might get us a working baseline). Could you try and see whether that makes things work on your box?

@2trc
Copy link
Author

2trc commented Dec 12, 2016

@chrysn thanks and let's follow one track

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

No branches or pull requests

2 participants