Removed duplicate code from SyncSocket