socketTest.php write,exept and Error handling