Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #37950

Re: pyrudp

References <-8366160877585761872@unknownmsgid> <0fc69471-a63b-4b4e-8e70-d0e3daa2fa74@ucimail4.uci.cu>
Date 2013-01-30 18:01 +0000
Subject Re: pyrudp
From Rob Day <robert.day@merton.oxon.org>
Newsgroups comp.lang.python
Message-ID <mailman.1221.1359568898.2939.python-list@python.org> (permalink)

Show all headers | View raw


Have you seen http://pyraknet.slowchop.com/? It appears to do a similar thing.

On 30 January 2013 17:02, Jorge Alberto Diaz Orozco
<jaorozco@estudiantes.uci.cu> wrote:
> I´ve tried it but it´s not reliable. Datagrams can arive disorganised or just not arive.
> Some programmers said I most use TCP, but I need to use UDP.
> that´s why I need pyrudp, but I can not find it.
>
> On Jan 30, 2013, at 8:12 AM, Jorge Alberto Diaz Orozco
>
> What about the native socket call to SOCK_DGRAM?
>
> Here is a simple example to read messages of a udp socket.
>
> import socket
> UDP_IP = "127.0.0.1"
> UDP_PORT = 5005
>
> sock = socket.socket(socket.AF_INET, # Internet
> socket.SOCK_DGRAM) # UDP
> sock.bind((UDP_IP, UDP_PORT))
>
> while True:
>     data, addr = sock.recvfrom(1024) # buffer size is 1024 bytes
>     print "received message:", data
> --
> http://mail.python.org/mailman/listinfo/python-list



-- 
Robert K. Day
robert.day@merton.oxon.org

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: pyrudp Rob Day <robert.day@merton.oxon.org> - 2013-01-30 18:01 +0000

csiph-web