i use SocketType.sub and SocketType.pub to connect and bind from udp addressi watched documentation of zmq and i must use socket type as like Radio and Dish but i can't find it in dartzmq
my simple code like this :
import 'dart:io';import 'package:dartzmq/dartzmq.dart';void dishRadioDart() async { String udpAddress = "udp://127.0.0.1:5566"; final context = ZContext(); final dishSocket = context.createSocket(SocketType.pub); final radioSocket = context.createSocket(SocketType.sub); try { dishSocket.bind(udpAddress); print("dish socket binded to address : ${udpAddress}"); radioSocket.connect(udpAddress); print("radio socket connect to address : ${udpAddress}"); radioSocket.setOption(ZMQ_SUBSCRIBE, ""); radioSocket.payloads.listen((event) { print("received message"); print("received message is : ${event}"); }); while (true) { print("send message "); dishSocket.sendString("abdullah message "); sleep(const Duration(seconds: 1)); } } catch (e) { print("error e : ${e}"); }}
i asked that in github too , any one can see that from this link : https://github.com/enwi/dartzmq/issues/31
in the end i'm trying to use udp protocol with zeromq in my flutter application to send and receive some control items between python application and flutter application .any one can help me here .