server

Description

Monitors for connections on a TCP/IP port.

Source Files

RtxTcpServer project source file:

Build the Sample

  1. Open the solution in the desired Visual Studio version you wish to build.
  2. Once Visual Studio is open, build the sample in any desired configuration that is available.

Run the Sample

  1. Run with the I flag set to the machine's IP address.
  2. Use the Client sample to send packets to Server.
  3. Send the kill command to Client to shut down Server. Alternately, you can use RtssKill to shut down Server from the RTSS side.

Remarks

The server program can be built as an .rtss or .exe executable binary file and run in the real-time or Win32 environment.

Usage

server.exe i= destination ip_address [options]

Options

i= source IP address (if needed)

v= 0 or 1 verbose flag prints extra info (default 0)

p= Port Number (default=9999)

n= 0,1 - Nagle Alg. Disabled(default), Enabled

f= v4 or v6 (default=v4)

/udp - use udp instead of tcp

/s - Use single threading (multi-threaded is the default)

/? - displays this message

APIs Referenced

RTAPI

Win32 APIs

Winsock BSD APIs

RtAtoi

RtAttachShutdownHandler

RtPrintf

CloseHandle

CreateThread

ExitProcess

ExitThread

GetLastError

GetProcessHeap

HeapAlloc

Sleep

accept

bind

closesocket

freeaddrinfo

getaddrinfo

getnameinfo

getsockname

getsockopt

inet_addr

ioctlsocket

listen

recv

recvfrom

select

send

sendto

setsockopt

shutdown

socket

WSACleanup

WSAGetLastError

WSAStartUp

See Also

RtxTcpServer

IntervalZero.com | Support | Give Feedback