network: adapt stream socket class and tests to psr-0