udp_data = udp_socket.recvfrom(1024) #接收数据,1024表示本次接收的最大字节数 if udp_data[0].decode(encoding='gbk') != 'end': print('{}:{}'.format(str(udp_data[1]), udp_data[0].decode(encoding='gbk'))) else: break udp_socket.close() #关闭套接字 if __name__ == '__mai...
udpclient.cpp: In function ‘int UdpSendData(char)’: udpclient.cpp:99:94: error: cannot convert ‘sockaddr_in*’ to ‘const sockaddr*’ for argument ‘5’ to ‘ssize_t sendto(int, const void*, size_t, int, const sockaddr*, socklen_t)’ rc = sendto(client_fd, deviceBuffer1, si...