Service Fabric Stateless Server Custom UDP Listener

后端 未结 3 534
暖寄归人
暖寄归人 2021-01-07 04:20

We are trying to define a Service Fabric Stateless Service which listeners for UDP data.

We are working with Microsoft who have said that it IS supported and that I

3条回答
  •  佛祖请我去吃肉
    2021-01-07 04:51

    There was an defect with the UdpServer component which I resolved and this now works hosted in a Service Fabric Service.

    The issue with the code wa with this line :

    _udpClient = new UdpClient(ipAddress, port);
    

    This is the wrong overload for listening for traffic, it needed to be:

    _udpClient = new UdpClient(port);
    

    I did try :

    _udpClient = new UdpClient(new IPAddress(IPAddress.Parse(_ipAddress)),port)
    

    But this doesn't work; as the line from the Communication listen (as it describes itself) which retrieves the host returns the hostname and not the IPAddress, I think you could alter this behaviour by makes some changes to the manifest but just the port was sufficient for now.

提交回复
热议问题