mas-bandwidth / netcode

Secure client/server connections over UDP
BSD 3-Clause "New" or "Revised" License
2.44k stars 191 forks source link

Print warning when disabling SIO_UDP_CONNRESET fails. #124

Closed dbechrd closed 2 months ago

dbechrd commented 2 months ago

It's tagged as "IMPORTANT" in the comment, so perhaps add a message when it fails? I don't think this particular setting failing to be set warrants destroying the socket, though, so I opted not to do that.

gafferongames commented 2 months ago

Please make this an error and destroy the socket. In fact, without this setting working successfully -- the windows build is quite broken. So it's OK to make it a fatal error. No need for "warning:". ps. if in future you do find actual warning conditions, you can just use NETCODE_LOG_LEVEL_WARN

dbechrd commented 2 months ago

Updated level to error and will now the destroy socket on failure.

gafferongames commented 2 months ago

There's no need to add "error: " to the message -- when you use error log level, it prepends it to your text automatically

dbechrd commented 2 months ago

There's no need to add "error: " to the message -- when you use error log level, it prepends it to your text automatically

Are you sure? I don't see any logic in netcode_printf that prints the error level. I was just following the pattern that all of the other error messages use. That would be a logical improvement to make to the default logger implementation though.

gafferongames commented 2 months ago

Sorry, I'm getting netcode mixed up with my newer projects (network next etc...) that do the prefixing. Apologies.