If any packet is somehow lost during communication, TCP will automatically retransmit the packet until the destination host acknowledges that packet.
socket_create() Returns a socket resource on success, or FALSE on error. The actual error code can be retrieved by calling socket_last_error(). This error code may be passed to socket_strerror() to get a textual explanation of the error.