Azure / Azure/DotNetty

PlatformNotSupportedException: This platform does not support packet information for dual-mode sockets

Open
#426 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.3k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Running on .NET Core (2.1.401) under MacOS (10.13.6) and using a `SocketDatagramChannel` I get the following error when I am testing an Outbound handler that wraps my byte buffer into a `DatagramPacket`

Running the same code under Windows 10 and .NET Core (2.1.401) No `PlatformNotSupportedException` is thrown

```
var packet = new DatagramPacket(
message: (IByteBuffer)message,
recipient: new IPEndPoint(IPAddress.Loopback, port:10000)
);

return context.WriteAndFlushAsync(packet);
```

```
Exception: System.PlatformNotSupportedException: This platform does not support packet information for dual-mode sockets. If packet information is not required, use Socket.Receive. If packet information is required set Socket.DualMode to false.
at System.Net.Sockets.SocketPal.CheckDualModeReceiveSupport(Socket socket)
at System.Net.Sockets.Socket.ReceiveFromAsync(SocketAsyncEventArgs e)
at DotNetty.Transport.Channels.Sockets.SocketDatagramChannel.ScheduleSocketRead()
at DotNetty.Transport.Channels.AbstractChannel.AbstractUnsafe.BeginRead()
```

Is there a way to disable the DualMode flag? I passed my own `new Socket(.. udp ..).DualMode = false` to a ```.ChannelFactory(() => new SocketDatagramChannel(socket))``` but that didn't seem to do it.

I get that it's a NET Core issue, what I am looking for is a way around that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.