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);
Содержание TC1
Страница 1: ...TC1 User Manual Version of this document V1 00r0 ...
Страница 25: ...5 Hardware User Manual 25 374 5 2 2 Block Diagram Variant TC1 WIFI ...
Страница 34: ...5 Hardware User Manual 34 374 5 6 Housing Connector Top view and side view Bottom View ...
Страница 125: ...7 Teleservice Application Framework User Manual 125 374 TAF overview ...
Страница 174: ...7 Teleservice Application Framework User Manual 174 374 ADDRESS 6 SIZE 4 TYPE UINT32 UNIT COMMENT EnginePower ...
Страница 190: ...7 Teleservice Application Framework User Manual 190 374 How the logger mechanism works ...
Страница 223: ...7 Teleservice Application Framework User Manual 223 374 Association between logic hysteresis and threshold ...
Страница 293: ...8 Development Tools User Manual 293 374 3 Adapt the Build Options in order to build the binary with debug symbols ...
Страница 302: ...8 Development Tools User Manual 302 374 2 Adapt the Build Options in order to build the binary with debug symbols ...