Create a socket connected to an existing server.
TCPConnect ( IPAddr, port )
| IPAddr | Internet Protocol dotted address(IpV4) as "192.162.1.1". |
| port | port on which the created socket will be connected. |
| Success: | Returns main socket identifier. |
| Failure: | Returns -1 or 0 and set @error. |
| @error: | 1 IPAddr is incorrect. |
| 2 port is incorrect. | |
| windows API WSAGetError return value (see MSDN). |
;CLIENT!!!!!!!! Start SERVER First... dummy!!
Local $g_IP = "127.0.0.1"
; Start The TCP Services
;==============================================
TCPStartup()
; Connect to a Listening "SOCKET"
;==============================================
Local $socket = TCPConnect($g_IP, 65432)
If $socket = -1 Then Exit