How to IResourceProvider<Socket> in C#

I have an IResourceProvider in my code so I can use it internally. The reason I have chosen this way is because first it is needful to chunkify my data and do a CRC check before I send them.

I dont know how to proceed, I have initialized a UDP Socket successfully and feeding it to my process (so far so good)

image

but then what I have to do in order to consume it?
Do or Using and when I do so, why I am getting an error for the binding address and port?

this is where I am so far:

Socket.Using(x => x.Send(chunk.ToArray(), dataBytesForThisChunk, SocketFlags.Multicast));

I think you need to send us a bit more code than this. In the meantime, maybe looking into our std lib helps? You find some examples of socket and resource provider usage by doing a search on github, like this one.

1 Like