TCPIP
Description
This sample includes a simplified TCP server, a simplified blocking TCP client, and a simplified non-blocking TCP client.
- A client connects to a server, sends one packet, receives an echoed packet, and then closes the connection.
- The server accepts a connection from a client and echoes received packets back to the client. It terminates when the connection is closed.
- A non-blocking TCP client sample demonstrates how to connect a non-blocking client to a server for the RT-TCP/IP Stack, which is different from Windows.
Source Files
File | Description |
---|---|
TCPIPClient.c
|
Source File for TCP Client. |
TCPIPClientNblock.c
|
Source file demonstrating use of API connect for a non-blocking socket. |
TCPIPClientServer.h
|
Header file. |
TCPIPServer.c
|
Source File for TCP Server. |
TCPIPClient_VS<Visual Studio Version>.vcxproj
|
Client project file for supported versions of Visual Studio. |
TCPIPServer_VS<Visual Studio Version>.vcxproj
|
Server project file for supported versions of Visual Studio. |
TCPIP_VS<Visual Studio Version>.sln
|
Solution file for supported versions of Visual Studio. |
ReadMe.txt
|
Text file containing a description of the sample and a list of provided files. |
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
Supported Windows API
Winsock BSD API
See Also