Coder Social home page Coder Social logo

bashkirtsevich-llc / aioudp Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 6.0 30 KB

Asyncio UDP server

Home Page: https://pypi.org/project/aio-udp-server/

License: GNU General Public License v3.0

Python 100.00%
asyncio async asynchronous async-await asynctask asynchronous-programming async-programming asynchronous-tasks asyncstorage async-functions

aioudp's People

Contributors

bashkirtsevich avatar wojciechmigda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aioudp's Issues

Split run() into setup and execution

Hi,
would it be possible to split run() method into preparation part, which creates sending and receiving coroutines and the execution part?

Right now, with the code I am integrating your module into, I had to copy-paste some of the run() functionality into:

def ready(self, host, port, loop=None):
    self.loop = loop or asyncio.get_event_loop()
    self.sock.bind((host, port))
    self.connection_made()
    stask = self._send_periodically()
    rtask = self._recv_periodically()
    return stask, rtask

so that later I could schedule execution with some other coroutine using Nursery from aionursery. Otherwise, I was running into exceptions being thrown while my app was exiting.
Thanks.

send silently handle all errors

I got an error: TypeError: a bytes-like object is required, not 'str' when writing to a file in Python3
Spend a lot of time debuging, cause you silently handle all errors:

        except Exception as e:
            fut.set_result(0)
            self._socket_error(e)

BTW, awesome library, thank you for sharing!

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.