Catch SendSocket in GenerateXscript
Fixed bug in reading