added missing includes for various socket types

compiler complains about it, if optimizations are enabled
initialize variable

compiler complais, that it the default switch case is used,
rc is not initialized