thomasarmel / socket-server-mocker

Mock socket server in Rust, for testing various network clients.
https://crates.io/crates/socket-server-mocker
MIT License
0 stars 2 forks source link

Make all options configurable #16

Closed nyurik closed 3 days ago

nyurik commented 5 days ago

Introduce new structs:

Removed default timeouts - they are now part of the default options - so must release 0.4.0.

Would it make sense to combine UDP and TCP together into one struct? I don't see much difference between the two, and they do have the same API except for a few things?

thomasarmel commented 4 days ago

Hi, Thank you very much!

Would it make sense to combine UDP and TCP together into one struct?

I don't know... As explained in issue #3 I plan (in an unknown future...) to add a new struct, something like TLSServerMocker, and why not QUICServerMocker. So that I would prefer to keep the trait common interface.

nyurik commented 4 days ago

I don't know... As explained in issue #3 I plan (in an unknown future...) to add a new struct, something like TLSServerMocker, and why not QUICServerMocker. So that I would prefer to keep the trait common interface.

I don't understand, how is having a common interface relevant to adding a new type of a server? Moreover, I don't understand the benefit of having multiple structs implement the same trait. In any case, I think this is irrelevant because it might be better to have one "server" struct that takes an option struct, and it would support tcp,udp,quic,etc

thomasarmel commented 3 days ago

It might be better to have one "server" struct that takes an option struct, and it would support tcp,udp,quic,etc

Ok for me :+1: