EasyManuals Logo

STW TC1 User Manual

STW TC1
374 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #53 background imageLoading...
Page #53 background image
6 Software
User Manual 53/374
struct sockaddr_in t_Srv;
memset(&t_Srv, 0, sizeof(struct sockaddr_in));
t_Srv.sin_family = AF_INET;
inet_pton(AF_INET, "1.2.3.4", &t_Srv.sin_addr); // Set server IP to struct sockaddr_in
t_Srv.sin_port = htons(1234); // Set port in Network-Byte-Order (Big Endian) to sin_port
s16_Return = connect(s16_Sockfd, (struct sockaddr*)&t_Srv, sizeof(struct sockaddr_in)); //
Try to connect
if(s16_Return == 0)
{
// TCP connection is established. Now write() and read() could be used to to write or read
sockets
[...] // Data handling
shutdown(s16_Sockfd, SHUT_WR); // Send a EOF-Byte to the server, so that on the next read()
we will get a 0-return and we could close the connection
close(s16_Sockfd);

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the STW TC1 and is the answer not in the manual?

STW TC1 Specifications

General IconGeneral
BrandSTW
ModelTC1
CategoryController
LanguageEnglish