improved testing and connection handling

This commit is contained in:
Joseph Henry
2017-04-20 13:39:46 -07:00
parent c65b609fb4
commit 76abb3e0a2
30 changed files with 2430 additions and 775 deletions

View File

@@ -52,12 +52,11 @@ int main()
printf("waiting for service to issue an address\n");
sleep(1);
}
// Begin Socket API calls
int err;
int sockfd;
int port = 5555;
int port = 7878;
struct sockaddr_in addr;
// socket()
@@ -69,7 +68,7 @@ int main()
// connect() IPv6
if(false)
{
struct hostent *server = gethostbyname2("fde5:cd7a:9e1c:fd2:7299:932e:e35a:9a03",AF_INET6);
struct hostent *server = gethostbyname2("fde5:cd7a:9e1c:0fd2:7299:9367:5993:3b86",AF_INET6);
struct sockaddr_in6 serv_addr;
memset((char *) &serv_addr, 0, sizeof(serv_addr));
serv_addr.sin6_flowinfo = 0;
@@ -91,6 +90,10 @@ int main()
printf("error connecting to remote host (%d)\n", err);
return -1;
}
zts_write(sockfd, "hello", 5);
sleep(3);
zts_close(sockfd);
}
// bind() ipv4
if(false)
@@ -129,12 +132,12 @@ int main()
printf("peer_count = %lu\n", zts_get_peer_count());
/*
while(1)
{
sleep(1);
}
*/
// ---