Add SocketDiagTCPInfo with some constants and structs to get tcp_info…#534
Conversation
|
G'day @RealFatCat , This is a really great PR.
|
|
Yeah, found the problem that in different kernels we have different size of tcp_info struct. Any advises how to handle this? UPD: Probably, need to determine version of current kernel and read that byte or not. |
|
Yeap, understand problem now. |
|
Probably, there is no issue with |
|
This is probably not the most beautiful solution, but should work on every kernel. |
e2c06bf to
faaf133
Compare
|
Is it feasible to add a UT for this ? |
faaf133 to
5b160c9
Compare
I really don't know how to do it properly. It seems like we need to mock kernel answers somehow, to compare them with expected stats data. But how. |
|
This looks good? How about a unit test to make sure that the request to the kernel for stats returns data without actually checking the values to see if they are valid? That would at least validate that the call works. |
|
Will do. |
… via sock_diag Add simple test for SocketDiagTCPInfo
0ce815d to
b08e583
Compare
… via sock_diag.
Probably, needs some restructurisation.