davidk wrote:

> Here is my UDP Server Block Python Code:
> 
> /import numpy
> import socket
> from gnuradio import gr
> from gnuradio import blocks
> 
> UDP_IP = "192.168.10.2"
> UDP_PORT = 58
> 
> sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
> 
> class serverSource(gr.sync_block):
>     def __init__(self):
>     
>     
> gr.sync_block.__init__(self,name="serverSource",in_sig=None,out_sig=[numpy.float32])
>         print "Setting up server"
>         sock.bind((UDP_IP, UDP_PORT))

Shouldn't there be a:
  sock.listen(1)
  self.clientsock, _ = sock.accept()

here?

>     def work(self, input_items, output_items):
>         out = output_items[0]
>         data, addr = sock.recvfrom(1024)

And I guess this should receive from the client sock. Not the server socket.
Hence:
   data, addr = self.clientsock.recvfrom(1024)

-- 
--gv

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to