EasyManua.ls Logo

SystemBase Portbase-3010 - Page 116

SystemBase Portbase-3010
118 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Portbase User Guide
GetData();
}
close(sock);
}
//Creates the data packet to transmit it to the server.
void SendData(void)
{
int i;
char temp[30] = "This is LoopBack Data !";
// Outputs data with the socket number 4001 of Porter.
write(sock, temp, sizeof(temp));
}
//Outputs received data on the screen.
void GetData(void)
{
int readval;
char readbuff[255];
// Reads data by the socket number 4001 of Porter.
readval = read(sock, readbuff, sizeof(readbuff));
if (readval < 1) return;
readbuff[readval] = 0;
printf("%s",readbuff);
}
116

Table of Contents