Client-Server(Daemon) Example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Client-Server(Daemon) Example

Client-Server(Daemon) Example

Hello All,

 


I want to share a client-server project. In this example the server can accept more than one client (Daemon server implementation). This example was created and tested using MQX4.2, CodeWarrior 10.6 and FRDM-K64F boards.

 166177_166177.pngpastedImage_2.png

 

In general, the client-server model is the most common communication model used by the applications such as HTTP, Telnet, FTP, SSH, and others. In a client-server model, the server listens to client requests and waits for new connections. When a client needs to connect to a server, it sends a request. The server acknowledges the request, and if the client is supported by the server, the connection is established.  

A TCP client-server communication can be implemented as in the following figure.

166196_166196.pngpastedImage_3.png

 

 

 

 

SETTING THE RTCS

Below are presented the steps required to set the RTCS with the default settings:

  1. Create the RTCS. This step reserves memory for different RTCS parameters and initializes the TCP/IP task.

Each project (server and client) contains an RTCS.c file which contains the initialize networking function with the RTCS configuration.

 166197_166197.pngpastedImage_6.png

 

  1. Set the RTCS IP address to the device after initialization.

The main.h files have the macros and variables that store the IP parameters. You can change the IP address according your needs.

166198_166198.pngpastedImage_8.png

In RTCS.c files,  the following code sets the address, mask, gateway and server IP addresses.

ip_addr = IPADDR(A,B,C,D);

phy_addr = BSP_DEFAULT_ENET_DEVICE;

.

.

.

ip_data.ip = ip_addr;

ip_data.mask = ENET_IPMASK;

ip_data.gateway = 0;

 

 

  1. Calculate the MAC address for the device using the variables.

Use the ENET_get_mac_address() function to build a valid MAC address for the application. MAC address calculation takes the device number and IP address as parameters, and returns a valid MAC address in the IPCFG_default_enet_address variable.

166199_166199.pngpastedImage_10.png

 

  1. Initialize the Ethernet device available in the board with the calculated MAC address.

Use the ipcfg_init_device() function to tell the RTCS task what Ethernet device should be used and to set the calculated MAC address to that device. Once the MAC address is set and the device is initialized, it is possible to bind the device to the IP address.

error = ipcfg_init_device (phy_addr, serverAddress);


 

 

  1. After Ethernet device initialization, bind the device to the IP address and it is ready to communicate.

/* If DHCP Enabled, get IP address from DHCP server */

             if (dhcp) {

                    printf("\nDHCP bind ... ");

                    error = ipcfg_bind_dhcp_wait(phy_addr, 1, &ip_data);

                    if (error != IPCFG_ERROR_OK) {

                           printf("Error %08x!\n", error);

                    }

                    else {

                           printf("Successful!\n");

                    }

             } else {

       /* Else bind with static IP */

                    printf ("\nStatic IP bind ... ");

                    error = ipcfg_bind_staticip(phy_addr, &ip_data);

 

                    if (error != IPCFG_ERROR_OK) {

                           printf("Error %08x!\n",error);

                    }

                    else {

                           printf("Successful!\n");

                    }

             }

 

 

SERVER IMPLEMENTATION

            

For the server implementation, MQX uses a socket structure that is created and filled in this way:

laddr.sin_family      = AF_INET;

laddr.sin_port        = CONNECT_PORT;

laddr.sin_addr.s_addr = INADDR_ANY;

 

The socket() function creates an unbound socket in a communications domain. This function also returns a handler used in later function calls that operate on sockets.

/* Listen on TCP port */

listensock = socket(PF_INET, SOCK_STREAM, 0);

if (listensock == RTCS_SOCKET_ERROR)

{

error = RTCSERR_OUT_OF_SOCKETS;

}

 

The bind() function assigns a local socket address to a socket and the listen() function marks a socket as accepting connections.

error = bind(listensock, &laddr, sizeof(laddr));

if (!error)

{

       error = listen(listensock, 0);

}

 

The accept() function extracts the first connection on the queue of pending connections, creates a new socket with the same socket type protocol and address family as the specified socket, and allocates a new file descriptor for that socket.

child_sock = accept(listensock, NULL, NULL);

 

The recv() function receives a message from a socket.

error = recv(sock, (void *)cRecvBuff, sizeof(cRecvBuff), MSG_WAITALL);

                   

The send() function initiates transmission of a message from the specified socket to its peer. The send() function sends a message only when the socket is connected.

error= send(sock, (void *)cRecvBuff, sizeof(cRecvBuff), 0);

 

 

The messages received are checked in order to toggle a LED or shutdown the connection.

while(1)

       {

             error = recv(sock, (void *)cRecvBuff, sizeof(cRecvBuff), MSG_WAITALL);

             printf("Received: %s\n", cRecvBuff);

             if (error == RTCS_ERROR)

             {

                    printf("There was an error code %lx\n", RTCS_geterror(sock));

                    shutdown(sock, FLAG_CLOSE_TX);

                    return;

             }

             if(cRecvBuff[0]=='T')

             {

                    printf("Received: %s\n", cRecvBuff);

                    printf("LED was toggled from child\r\n");

                    lwgpio_toggle_value(&led1);

             }

             if(cRecvBuff[0]=='G')

             {                         

                    printf("Received: %s\n", cRecvBuff);

                    printf("Shutting down connection\n");

                    shutdown(sock,FLAG_CLOSE_TX);

                    _time_delay(2000); 

                    _task_abort(MQX_NULL_TASK_ID);

             }    

       }           

CLIENT IMPLEMENTATION

 

For the client implementation, it uses a socket structure that is created and filled in this way:

addr.sin_family      = AF_INET;

addr.sin_port        = DESTPORT;

addr.sin_addr.s_addr = IPADDR(192,168,1,200); //Server address

 

The socket() function creates an unbound socket.

sock = socket(PF_INET, SOCK_STREAM, 0);

 

 

The connect() function attempts to make a connection on a socket.

error = connect(sock, &addr, sizeof(addr));

      

The recv() function receives a message from a socket.

error= recv(sock, (void *)cReadBuff, sizeof(cReadBuff), 0);

      

 

The send() function sends a message only when the socket is connected (including when the peer of a connectionless socket has been set via connect() function).

error = send(sock, (void *)cReadBuff, sizeof(cReadBuff), 0);

      

 

In addition the client example can toggle a LED in the server board or destroy the socket.

/*****Infinite loop waiting for user to push a button***/

while(1){

       if(lwgpio_get_value(&btn1) == LWGPIO_VALUE_LOW)

       {

             _time_delay(150);

             sprintf((char *)cReadBuff, "Toggle from client2\n");

             printf("Sending: %s", cReadBuff);

             error = send(sock, (void *)cReadBuff, sizeof(cReadBuff), 0);

             if (error == RTCS_ERROR)

             {

                    printf("There was an error trying to send to the server\n");

                    return;

             }

       }

       if(lwgpio_get_value(&btn2) == LWGPIO_VALUE_LOW)

       {

             _time_delay(150);

             sprintf((char *)cReadBuff, "GoodBye\n");

             printf("Sending: %s", cReadBuff);

             error = send(sock, (void *)cReadBuff, sizeof(cReadBuff), 0);

             if (error == RTCS_ERROR)

             {

                    printf("There was an error trying to send to the server\n");

                    return;

             }

             printf("Shutting down connection\n");

             shutdown(sock,FLAG_CLOSE_TX);

             _task_abort(MQX_NULL_TASK_ID);

       }

 

 

 

I hope this helps,

Soledad

Original Attachment has been moved to: ClientD_FRDM-K64_MQX4_2_CW10_6.zip

Original Attachment has been moved to: ServerDeamon_FRDM-K64_MQX4_2_CW10_6.zip

Tags (3)
Comments

I am really happy to say it’s an interesting post to read. I learn new information from your article , you are doing a great job. Keep it up.

psiphon

%3CLINGO-SUB%20id%3D%22lingo-sub-1111286%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EClient-Server(Daemon)%20Example%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1111286%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%20I%20want%20to%20share%20a%20client-server%20project.%20In%20this%20example%20the%20server%20can%20accept%20more%20than%20one%20client%20(Daemon%20server%20implementation).%20This%20example%20was%20created%20and%20tested%20using%20MQX4.2%2C%20CodeWarrior%2010.6%20and%20FRDM-K64F%20boards.%3C%2FP%3E%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166177_166177.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166177_166177.png%22%20style%3D%22width%3A%20626px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118056iD805C1E134FCAB44%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22166177_166177.png%22%20alt%3D%22166177_166177.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_2.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_2.png%22%20style%3D%22width%3A%20626px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F3708i27BF57FC04A88E26%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_2.png%22%20alt%3D%22pastedImage_2.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20general%2C%20the%20client-server%20model%20is%20the%20most%20common%20communication%20model%20used%20by%20the%20applications%20such%20as%20HTTP%2C%20Telnet%2C%20FTP%2C%20SSH%2C%20and%20others.%20In%20a%20client-server%20model%2C%20the%20server%20listens%20to%20client%20requests%20and%20waits%20for%20new%20connections.%20When%20a%20client%20needs%20to%20connect%20to%20a%20server%2C%20it%20sends%20a%20request.%20The%20server%20acknowledges%20the%20request%2C%20and%20if%20the%20client%20is%20supported%20by%20the%20server%2C%20the%20connection%20is%20established.%20%26nbsp%3B%3C%2FP%3E%3CP%3EA%20TCP%20client-server%20communication%20can%20be%20implemented%20as%20in%20the%20following%20figure.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166196_166196.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166196_166196.png%22%20style%3D%22width%3A%20617px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118057iC98C97C77DFD09DB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22166196_166196.png%22%20alt%3D%22166196_166196.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_3.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_3.png%22%20style%3D%22width%3A%20617px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F3753iFEEF56CB6A197656%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_3.png%22%20alt%3D%22pastedImage_3.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%20style%3D%22font-size%3A%2014.0pt%3B%22%3ESETTING%20THE%20RTCS%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EBelow%20are%20presented%20the%20steps%20required%20to%20set%20the%20RTCS%20with%20the%20default%20settings%3A%3C%2FP%3E%3COL%3E%3CLI%3E%3CSTRONG%3E%20Create%20the%20RTCS.%20This%20step%20reserves%20memory%20for%20different%20RTCS%20parameters%20and%20initializes%20the%20TCP%2FIP%20task.%20%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EEach%20project%20(server%20and%20client)%20contains%20an%20RTCS.c%20file%20which%20contains%20the%20initialize%20networking%20function%20with%20the%20RTCS%20configuration.%3C%2FP%3E%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166197_166197.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166197_166197.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118058iCED807B292FDC244%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22166197_166197.png%22%20alt%3D%22166197_166197.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_6.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_6.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F3806i11E235EC7493A3CD%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_6.png%22%20alt%3D%22pastedImage_6.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%3COL%20start%3D%222%22%3E%3CLI%3E%3CSTRONG%3E%20Set%20the%20RTCS%20IP%20address%20to%20the%20device%20after%20initialization.%20%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EThe%20main.h%20files%20have%20the%20macros%20and%20variables%20that%20store%20the%20IP%20parameters.%20You%20can%20change%20the%20IP%20address%20according%20your%20needs.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166198_166198.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166198_166198.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118059i3FDC461CF71AE440%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22166198_166198.png%22%20alt%3D%22166198_166198.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_8.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_8.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F3862iD843910AD8B6D9F2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_8.png%22%20alt%3D%22pastedImage_8.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIn%20RTCS.c%20files%2C%20%26nbsp%3Bthe%20following%20code%20sets%20the%20address%2C%20mask%2C%20gateway%20and%20server%20IP%20addresses.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eip_addr%20%3D%20IPADDR(A%2CB%2CC%2CD)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Ephy_addr%20%3D%20BSP_DEFAULT_ENET_DEVICE%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E.%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eip_data.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Eip%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%3D%20ip_addr%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eip_data.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Emask%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%3D%20ENET_IPMASK%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eip_data.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Egateway%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%3D%200%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3COL%20start%3D%223%22%3E%3CLI%3E%3CSTRONG%3E%20Calculate%20the%20MAC%20address%20for%20the%20device%20using%20the%20variables.%20%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EUse%20the%20ENET_get_mac_address()%20function%20to%20build%20a%20valid%20MAC%20address%20for%20the%20application.%20MAC%20address%20calculation%20takes%20the%20device%20number%20and%20IP%20address%20as%20parameters%2C%20and%20returns%20a%20valid%20MAC%20address%20in%20the%20IPCFG_default_enet_address%20variable.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166199_166199.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22166199_166199.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F118060iE7F3722442A3A782%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22166199_166199.png%22%20alt%3D%22166199_166199.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_10.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22pastedImage_10.png%22%20style%3D%22width%3A%20624px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F3906iE49465A93FB2346C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22pastedImage_10.png%22%20alt%3D%22pastedImage_10.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22min-height%3A%208pt%3B%20padding%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3COL%20start%3D%224%22%3E%3CLI%3E%3CSTRONG%3E%20Initialize%20the%20Ethernet%20device%20available%20in%20the%20board%20with%20the%20calculated%20MAC%20address.%20%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EUse%20the%20ipcfg_init_device()%20function%20to%20tell%20the%20RTCS%20task%20what%20Ethernet%20device%20should%20be%20used%20and%20to%20set%20the%20calculated%20MAC%20address%20to%20that%20device.%20Once%20the%20MAC%20address%20is%20set%20and%20the%20device%20is%20initialized%2C%20it%20is%20possible%20to%20bind%20the%20device%20to%20the%20IP%20address.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Eipcfg_init_device%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(phy_addr%2C%20serverAddress)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22text-indent%3A%2035.4pt%3B%20margin%3A%200in%200in%20.0001pt%2035.4pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22text-indent%3A%2035.4pt%3B%20margin%3A%200in%200in%20.0001pt%2035.4pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22text-indent%3A%2035.4pt%3B%20margin%3A%200in%200in%20.0001pt%2035.4pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3COL%20start%3D%225%22%3E%3CLI%3E%3CSTRONG%3E%20After%20Ethernet%20device%20initialization%2C%20bind%20the%20device%20to%20the%20IP%20address%20and%20it%20is%20ready%20to%20communicate.%3C%2FSTRONG%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%20text-indent%3A%2035.4pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*%20If%20DHCP%20Enabled%2C%20get%20IP%20address%20from%20DHCP%20server%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(dhcp)%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22%5CnDHCP%20bind%20...%20%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20error%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Eipcfg_bind_dhcp_wait%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(phy_addr%2C%201%2C%20%26amp%3Bip_data)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(error%20!%3D%20IPCFG_ERROR_OK)%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Error%20%2508x!%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2C%20error)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eelse%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Successful!%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eelse%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*%20Else%20bind%20with%20static%20IP%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22%5CnStatic%20IP%20bind%20...%20%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20error%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Eipcfg_bind_staticip%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(phy_addr%2C%20%26amp%3Bip_data)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(error%20!%3D%20IPCFG_ERROR_OK)%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Error%20%2508x!%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2Cerror)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eelse%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Successful!%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSTRONG%20style%3D%22font-size%3A%2014.0pt%3B%22%3ESERVER%20IMPLEMENTATION%3C%2FSTRONG%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EFor%20the%20server%20implementation%2C%20MQX%20uses%20a%20socket%20structure%20that%20is%20created%20and%20filled%20in%20this%20way%3A%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eladdr.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Esin_family%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%20AF_INET%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eladdr.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Esin_port%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%20CONNECT_PORT%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eladdr.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Esin_addr%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Es_addr%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%3D%20INADDR_ANY%3B%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20socket()%20function%20creates%20an%20unbound%20socket%20in%20a%20communications%20domain.%20This%20function%20also%20returns%20a%20handler%20used%20in%20later%20function%20calls%20that%20operate%20on%20sockets.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*%20Listen%20on%20TCP%20port%20*%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Elistensock%20%3D%20socket(PF_INET%2C%20SOCK_STREAM%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(listensock%20%3D%3D%20RTCS_SOCKET_ERROR)%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%20text-indent%3A%2035.4pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%20%3D%20RTCSERR_OUT_OF_SOCKETS%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20bind()%20function%20assigns%20a%20local%20socket%20address%20to%20a%20socket%20and%20the%20listen()%20function%20marks%20a%20socket%20as%20accepting%20connections.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Ebind%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(listensock%2C%20%26amp%3Bladdr%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(laddr))%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(!error)%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20error%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Elisten%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(listensock%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20accept()%20function%20extracts%20the%20first%20connection%20on%20the%20queue%20of%20pending%20connections%2C%20creates%20a%20new%20socket%20with%20the%20same%20socket%20type%20protocol%20and%20address%20family%20as%20the%20specified%20socket%2C%20and%20allocates%20a%20new%20file%20descriptor%20for%20that%20socket.%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Echild_sock%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Eaccept%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(listensock%2C%20NULL%2C%20NULL)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20recv()%20function%20receives%20a%20message%20from%20a%20socket.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Erecv%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cRecvBuff%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cRecvBuff)%2C%20MSG_WAITALL)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20send()%20function%20initiates%20transmission%20of%20a%20message%20from%20the%20specified%20socket%20to%20its%20peer.%20The%20send()%20function%20sends%20a%20message%20only%20when%20the%20socket%20is%20connected.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Esend%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cRecvBuff%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cRecvBuff)%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3EThe%20messages%20received%20are%20checked%20in%20order%20to%20toggle%20a%20LED%20or%20shutdown%20the%20connection.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Ewhile%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(1)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20error%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Erecv%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cRecvBuff%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cRecvBuff)%2C%20MSG_WAITALL)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Received%3A%20%25s%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2C%20cRecvBuff)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(error%20%3D%3D%20RTCS_ERROR)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22There%20was%20an%20error%20code%20%25%3CSPAN%20style%3D%22text-decoration%3A%20underline%3B%22%3Elx%3C%2FSPAN%3E%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3ERTCS_geterror%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock))%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20shutdown(sock%2C%20FLAG_CLOSE_TX)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Ereturn%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cRecvBuff%5B0%5D%3D%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E'T'%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Received%3A%20%25s%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2C%20cRecvBuff)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22LED%20was%20toggled%20from%20child%5Cr%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Elwgpio_toggle_value%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(%26amp%3Bled1)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cRecvBuff%5B0%5D%3D%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E'G'%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Received%3A%20%25s%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2C%20cRecvBuff)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Shutting%20down%20connection%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20shutdown(sock%2CFLAG_CLOSE_TX)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3E_time_delay%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(2000)%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3E_task_abort%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(MQX_NULL_TASK_ID)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSTRONG%20style%3D%22font-size%3A%2014.0pt%3B%22%3ECLIENT%20IMPLEMENTATION%3C%2FSTRONG%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EFor%20the%20client%20implementation%2C%20it%20uses%20a%20socket%20structure%20that%20is%20created%20and%20filled%20in%20this%20way%3A%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eaddr.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Esin_family%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%20AF_INET%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eaddr.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Esin_port%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3D%20DESTPORT%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eaddr.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Esin_addr%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E.%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%230000c0%3B%22%3Es_addr%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20%3D%20IPADDR(192%2C168%2C1%2C200)%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F%2FServer%20address%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20socket()%20function%20creates%20an%20unbound%20socket.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Esock%20%3D%20socket(PF_INET%2C%20SOCK_STREAM%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3EThe%20connect()%20function%20attempts%20to%20make%20a%20connection%20on%20a%20socket.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Econnect%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20%26amp%3Baddr%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(addr))%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3EThe%20recv()%20function%20receives%20a%20message%20from%20a%20socket.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Erecv%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cReadBuff%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cReadBuff)%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3EThe%20send()%20function%20sends%20a%20message%20only%20when%20the%20socket%20is%20connected%20(including%20when%20the%20peer%20of%20a%20connectionless%20socket%20has%20been%20set%20via%20connect()%20function).%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3Eerror%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Esend%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cReadBuff%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cReadBuff)%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20addition%20the%20client%20example%20can%20toggle%20a%20LED%20in%20the%20server%20board%20or%20destroy%20the%20socket.%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%233f7f5f%3B%22%3E%2F*****Infinite%20loop%20waiting%20for%20user%20to%20push%20a%20button***%2F%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Ewhile%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(1)%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Elwgpio_get_value%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(%26amp%3Bbtn1)%20%3D%3D%20%3C%2FSPAN%3E%3CEM%20style%3D%22color%3A%20%230000c0%3B%20font-size%3A%2010.0pt%3B%22%3ELWGPIO_VALUE_LOW%3C%2FEM%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3E_time_delay%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(150)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20sprintf((%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Echar%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cReadBuff%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Toggle%20from%20client2%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Sending%3A%20%25s%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2C%20cReadBuff)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20error%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Esend%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cReadBuff%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cReadBuff)%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(error%20%3D%3D%20RTCS_ERROR)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22There%20was%20an%20error%20trying%20to%20send%20to%20the%20server%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Ereturn%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Elwgpio_get_value%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(%26amp%3Bbtn2)%20%3D%3D%20%3C%2FSPAN%3E%3CEM%20style%3D%22color%3A%20%230000c0%3B%20font-size%3A%2010.0pt%3B%22%3ELWGPIO_VALUE_LOW%3C%2FEM%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3E_time_delay%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(150)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20sprintf((%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Echar%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cReadBuff%2C%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22GoodBye%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Sending%3A%20%25s%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%2C%20cReadBuff)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20error%20%3D%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3Esend%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(sock%2C%20(%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Evoid%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20*)cReadBuff%2C%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Esizeof%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(cReadBuff)%2C%200)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Eif%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%20(error%20%3D%3D%20RTCS_ERROR)%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22There%20was%20an%20error%20trying%20to%20send%20to%20the%20server%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%237f0055%3B%20font-size%3A%2010.0pt%3B%22%3Ereturn%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20printf(%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20%232a00ff%3B%22%3E%22Shutting%20down%20connection%5Cn%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20shutdown(sock%2CFLAG_CLOSE_TX)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin-bottom%3A%20.0001pt%3B%22%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSTRONG%20style%3D%22color%3A%20%23642880%3B%20font-size%3A%2010.0pt%3B%22%3E_task_abort%3C%2FSTRONG%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E(MQX_NULL_TASK_ID)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22font-size%3A%2010.0pt%3B%20color%3A%20black%3B%22%3E%7D%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin%3A%200in%3B%20margin-bottom%3A%20.0001pt%3B%22%3E%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3EI%20hope%20this%20helps%2C%3C%2FP%3E%3CP%3ESoledad%3C%2FP%3E%3CP%3E%3CSTRONG%3EOriginal%20Attachment%20has%20been%20moved%20to%3A%20%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-339762%22%20target%3D%22_blank%22%3EClientD_FRDM-K64_MQX4_2_CW10_6.zip%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EOriginal%20Attachment%20has%20been%20moved%20to%3A%20%3CA%20_jive_internal%3D%22true%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-339762%22%20target%3D%22_blank%22%3EServerDeamon_FRDM-K64_MQX4_2_CW10_6.zip%3C%2FA%3E%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1111286%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EReal-Time%20TCPIP%20Communications%20Suite%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1111287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Client-Server(Daemon)%20Example%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1111287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%20style%3D%22font-size%3A%2010pt%3B%20color%3A%20%23000000%3B%22%3EI%20am%20really%20happy%20to%20say%20it%E2%80%99s%20an%20interesting%20post%20to%20read.%20I%20learn%20new%20information%20from%20your%20article%20%2C%20you%20are%20doing%20a%20great%20job.%20Keep%20it%20up.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CSPAN%3E%3C%2FSPAN%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CA%20href%3D%22https%3A%2F%2Fwww.psiphon.onl%22%20style%3D%22color%3A%20%23000000%3B%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Epsiphon%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎10-19-2016 01:25 PM
Updated by: