> Hi,
>
> I'd like to get a simple "hello world" example working as a UDP server.  I
> could really use a little help.
>
> I am beginning with the examples/simple_logger.py sample code.
> I have a very simple client running in a loop which sends a UDP message to
> the server every few seconds.
>
>
> ...My code looks like this:
>
> import uwsgi
>
> print('\n\n --- This prints just fine ---\n\n')
>
> def app(ip, port, message):
>     print('\n\n --- Wish this would print ---\n\n')
>     return True
>
> uwsgi.udp_callable = app
>
>
> ...My ini file looks like this:
>
> [uwsgi]
> plugins = python
> socket = /tmp/metre.sock
> no-default-app = true
> module = example.app:app
> udp = :5000
> callable = app
> show-config = true
> vacuum = true
>
>
> ...I am running uwsgi version 2.0.1 with this command:
> $ uwsgi --ini example.ini
>
>
> The server launches and runs without errors.  I can see the print
> statement
> "This prints just fine", and a message "WSGI callable selected", so the
> python module is at least being loaded.
>
> I can see the messages sent from the client written to std out by the
> server
> (although they are not printed by my code).
>
> What I am *unable* to do is get the "app" function called.
>
> Could anyone offer a suggestion what I might try?
>
> Thank you very much.
>
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>

The udp higher-level management has been removed in 1.9/2.0 as running
custom code in the master is too dangerous (obviously the plugin hook has
not been removed, so users are free to attach to the udp socket in the way
they need/want)

Having said that, the real reason for removing it is that technically
there is no need to this abstraction for logging purposes. Just spawn a
thread (or a mule) to manage incoming udp packets.

Check the second example you can simply load it in a mule:

https://wiki.python.org/moin/UdpCommunication

-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to