You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: %s" % data)
`recvfrom` and `sendto` need to be overwritten. But also, the size of the buffer does matter. Basically, if a user needs to send a buffer over UDP it becomes their responsibility manage how many bytes to receive and possibly reconstruct on their end... which is not ideal.
UDP might even be pointless since slicing up an `np.ndarray` into smaller chunks and sending out of order or with dropped packets will result in it being impossible to reconstruct...
successfully completing this includes creating new examples
The text was updated successfully, but these errors were encountered:
sabjorn
changed the title
UDP Example
UDP Support -- maybe don't do
Sep 25, 2023
with the regular Python socket, sending and receiving is a little different, from https://wiki.python.org/moin/UdpCommunication):
for UDP send
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: %s" % data)
The text was updated successfully, but these errors were encountered: