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);
Summary of Contents for TC1
Page 1: ...TC1 User Manual Version of this document V1 00r0 ...
Page 25: ...5 Hardware User Manual 25 374 5 2 2 Block Diagram Variant TC1 WIFI ...
Page 34: ...5 Hardware User Manual 34 374 5 6 Housing Connector Top view and side view Bottom View ...
Page 125: ...7 Teleservice Application Framework User Manual 125 374 TAF overview ...
Page 190: ...7 Teleservice Application Framework User Manual 190 374 How the logger mechanism works ...