kerryjiang / SuperSocket

SuperSocket is a light weight, cross platform and extensible socket server application framework.
Apache License 2.0
3.95k stars 1.15k forks source link

Datagram support (equivalent to DatagramSocket in Java) #545

Open Delamaine opened 2 years ago

Delamaine commented 2 years ago

Does SuperSocket support datagrams similar to DatagramSocket in Java? Is there a standard receivefilter implemented in Supersocket for datagrams already, if not is it possible to implement such a filter?

chucklu commented 2 years ago

There are lots of standard filter https://github.com/kerryjiang/SuperSocket/tree/master/src/SuperSocket.ProtoBase

Delamaine commented 2 years ago

Thanks I am aware of those filters but do any of them work out of the box to support datagram as per my question?

chucklu commented 2 years ago

According https://en.wikipedia.org/wiki/Datagram#Structure, maybe you are looking for https://github.com/kerryjiang/SuperSocket/blob/master/src/SuperSocket.ProtoBase/FixedHeaderPipelineFilter.cs

Each datagram has two components, a header and a data payload. The header contains all the information sufficient for routing from the originating equipment to the destination without relying on prior exchanges between the equipment and the network. Headers may include source and destination addresses as well as a type field. The payload is the data to be transported. This process of nesting data payloads in a tagged header is called encapsulation.