message-io icon indicating copy to clipboard operation
message-io copied to clipboard

WIP: Add unix socket support?

Open javaarchive opened this issue 1 year ago • 5 comments

image Works on my machine borrowing most of the code from the tcp adapter. Has some implementation issues that I'll be putting as a list here:

  • peer and remote address is set to a filler value because there is a different SocketAddr type than required, not sure how I can convert between the two.
  • As seen in #171 , the path of the unix socket is currently hacked in via other options and the SocketAddr is completley ignored, considering using an Option here.
  • Throughput has no native UnixSocket test yet.

javaarchive avatar May 31 '24 06:05 javaarchive

Tested in release, websocket is only slow in debug for some reason, here is an output from the same computer for reference:

Sending 1GB in chunks of 65507 bytes:

message-io Udp:  	Throughput: 9.24 GB/s
message-io Tcp:  	Throughput: 5.68 GB/s
message-io FramedTcp:  	Throughput: 4.49 GB/s
message-io Ws:  	Throughput: 1.85 GB/s
message-io UnixSocket:  	Throughput: 9.61 GB/s

native Udp: 		Throughput: 10.24 GB/s
native Tcp: 		Throughput: 6.08 GB/s
native FramedTcp: 	Throughput: 4.78 GB/s
native Ws: 		Throughput: 1.94 GB/s

javaarchive avatar May 31 '24 19:05 javaarchive

Discovered implementation issue where messages sent after each other without a sleep are dropped.

Edit: this is fine for the stream based protocol

javaarchive avatar Jun 02 '24 22:06 javaarchive

image Datagram support throughput (in debug). For release: image I'm still finding it odd that the stream based transport slows down in release but that might just be variation while I'm testing this.

javaarchive avatar Jun 02 '24 23:06 javaarchive

Due to unix datagram sockets not really having an IPv4 or IPv6 that fits in the SocketAddr struct, the implementation is partially broken for now. I may see if I can change the types on a separate branch as an experiment.

javaarchive avatar Jun 03 '24 03:06 javaarchive

Hi @javaarchive, Mmmm... interesting the throughput issue. At such speeds could be noise in the runs. Is it always faster in debug or sometimes?

lemunozm avatar Jun 04 '24 18:06 lemunozm