Git Product home page Git Product logo

Comments (8)

CreatCodeBuild avatar CreatCodeBuild commented on August 12, 2024

which version of curio are you using? I am not aware of this issue.

The direct problem here is that sock in your context is a coroutine, which of course doesn't have a bind method.

But, I don't know why sock = socket.socket() returns a coroutine. It's only possible if curio API changed.

from hyper2web.

CreatCodeBuild avatar CreatCodeBuild commented on August 12, 2024

Can you paste your code?

from hyper2web.

wku avatar wku commented on August 12, 2024

Error in Element
Master Game Example
Https://github.com/CreatCodeBuild/hyper2web/blob/master/example/game/app.py

/home/wku/anaconda3/bin/python "/home/wku/Рабочий стол/[project]/[project_work]/mini/speed_test/server_hyper2web-/hyper2web-dev/example/game/app.py"
init a new record
Traceback (most recent call last):
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/kernel.py", line 826, in _run_coro
trap = current._send(current.next_value)
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/task.py", line 96, in _task_runner
return await coro
File "/home/wku/anaconda3/lib/python3.6/site-packages/hyper2web/server.py", line 24, in h2_server
sock = create_listening_ssl_socket(address, certfile, keyfile)
File "/home/wku/anaconda3/lib/python3.6/site-packages/hyper2web/sslsocket.py", line 23, in create_listening_ssl_socket
sock.bind(address)
AttributeError: 'coroutine' object has no attribute 'bind'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/wku/Рабочий стол/[project]/[project_work]/mini/speed_test/server_hyper2web-/hyper2web-dev/example/game/app.py", line 43, in
app.up()
File "/home/wku/anaconda3/lib/python3.6/site-packages/hyper2web/app.py", line 94, in up
shutdown=True)
File "/home/wku/anaconda3/lib/python3.6/site-packages/curio/kernel.py", line 214, in run
raise TaskError('Task Crashed') from ret_exc
curio.errors.TaskError: Task Crashed
sys:1: RuntimeWarning: coroutine 'CurioSSLContext.wrap_socket' was never awaited

Process finished with exit code 1

from hyper2web.

wku avatar wku commented on August 12, 2024

curio.version
'0.7'

from hyper2web.

CreatCodeBuild avatar CreatCodeBuild commented on August 12, 2024

This is the ssl.py in Curio.

Your problem is related with issue 225 in Curio, which I just opened.

You can either switch to wip branch or change the source code of hyper2web.

Just in case you are new to coroutines, this is a great tutorial from the author of Curio.

from hyper2web.

CreatCodeBuild avatar CreatCodeBuild commented on August 12, 2024

Anyway, thank you very much for trying out my framework. Your feedback is the most valuable. Feel free to discuss anything related to this framework. (Feature requests, docs ...)

from hyper2web.

CreatCodeBuild avatar CreatCodeBuild commented on August 12, 2024

The issue has been fixed in master branch sslsocket.py

        csock = ssl_context.wrap_socket(sock)
        while True:
            try:
                csock.send(None)
            except StopIteration as e:
                sock = e.value
                sock.bind(address)
                sock.listen()
                return sock

I have not updated the repo on pypi yet. Will close this issue after pypi update.

from hyper2web.

CreatCodeBuild avatar CreatCodeBuild commented on August 12, 2024

Has pushed the fix to pypi

from hyper2web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.