TCPIP

Description

This sample contains two executables. The Server, when executed, will wait until it receives a set amount of bytes followed by a signal to shut down. The program will display the number of bytes sent and then end its process. The Client will send a set amount of bytes to an IP address, confirm that the bytes have been received, and then end its process. This is all done in TCP protocol.

TCPIPClientNblock demonstrates how to use non-blocking connect. TCPIPClientNblock has the same command line arguments as TCPIPClient and behaves similarly.

Source Files

Source\

VS2017\

VS2015\

ReadMe.txt

Running the Sample

Launch RtssRun and type the following:

Rtssrun TCPIPServer.rtss

NOTE: This sample will choose the first interface IP. If you are using the Virtual Network, and you want to use an actual Network Interface Card for this sample, disable the Virtual NIC.

Rtssrun TCPIPClient.rtss <server IP Address>

APIs Referenced

RTAPI

Windows APIs

Winsock BSD APIs

RtPrintf

CloseHandle

CreateThread

ExitProcess

ExitThread

GetLastError

GetProcessHeap

HeapAlloc

Sleep

accept

bind

closesocket

freeaddrinfo

getaddrinfo

listen

recv

send

shutdown

socket

WSACleanup

WSAGetLastError

WSAStartUp

See Also

UDP

RtTcpipClient

RtTcpipServer