Server Socket TCP changed to fix buffer segmentation fault