Quantcast
Channel: Active questions tagged zeromq - Stack Overflow
Viewing all articles
Browse latest Browse all 193

Error when i Bind Or Connect With UDP Protocol (ZeroMQException(156384764): The protocol is not compatible with the socket type)

$
0
0

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 .


Viewing all articles
Browse latest Browse all 193

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>