Slight re-org of C API naming convention

This commit is contained in:
Joseph Henry
2021-05-05 16:19:27 -07:00
parent 85b861da2f
commit 9151f4471c
25 changed files with 24963 additions and 1518 deletions

View File

@@ -65,7 +65,7 @@ int main(int argc, char** argv)
// Create socket
if ((fd = zts_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0)) < 0) {
if ((fd = zts_bsd_socket(ZTS_AF_INET, ZTS_SOCK_STREAM, 0)) < 0) {
printf("Error (fd=%d, zts_errno=%d). Exiting.\n", fd, zts_errno);
exit(1);
}
@@ -73,8 +73,8 @@ int main(int argc, char** argv)
// Connect
// Can also use:
// zts_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen);
while (zts_simple_connect(fd, remote_addr, remote_port, 0) != ZTS_ERR_OK) {
// zts_bsd_connect(int fd, const struct zts_sockaddr* addr, zts_socklen_t addrlen);
while (zts_connect(fd, remote_addr, remote_port, 0) != ZTS_ERR_OK) {
printf("Attempting to connect...\n");
}
@@ -83,14 +83,14 @@ int main(int argc, char** argv)
// Wait random intervals to send a message to the server
// The non-blocking aspect of this example is server-side
while (1) {
if ((bytes = zts_send(fd, msgStr, strlen(msgStr), 0)) < 0) {
if ((bytes = zts_bsd_send(fd, msgStr, strlen(msgStr), 0)) < 0) {
printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, bytes, zts_errno);
exit(1);
}
printf("zts_send()=%d\n", bytes);
printf("zts_bsd_send()=%d\n", bytes);
zts_util_delay((rand() % 100) * 50);
}
zts_close(fd);
zts_bsd_close(fd);
return zts_node_stop();
}