test_autoclose.c | test_autoclose.c | |||
---|---|---|---|---|
skipping to change at line 68 | skipping to change at line 68 | |||
int TST_TOTAL = 1; | int TST_TOTAL = 1; | |||
int TST_CNT = 0; | int TST_CNT = 0; | |||
int | int | |||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | |||
{ | { | |||
int sk1, sk2; | int sk1, sk2; | |||
sockaddr_storage_t loop1, loop2; | sockaddr_storage_t loop1, loop2; | |||
struct msghdr inmessage, outmessage; | struct msghdr inmessage, outmessage; | |||
struct iovec iov, out_iov; | struct iovec iov, out_iov; | |||
int error, bytes_sent; | int error; | |||
char *big_buffer; | char *big_buffer; | |||
char *message = "hello, world!\n"; | char *message = "hello, world!\n"; | |||
uint32_t autoclose; | uint32_t autoclose; | |||
/* Rather than fflush() throughout the code, set stdout to | /* Rather than fflush() throughout the code, set stdout to | |||
* be unbuffered. | * be unbuffered. | |||
*/ | */ | |||
setvbuf(stdout, NULL, _IONBF, 0); | setvbuf(stdout, NULL, _IONBF, 0); | |||
loop1.v4.sin_family = AF_INET; | loop1.v4.sin_family = AF_INET; | |||
skipping to change at line 116 | skipping to change at line 116 | |||
test_setsockopt(sk2, SCTP_AUTOCLOSE, &autoclose, sizeof(autoclose)); | test_setsockopt(sk2, SCTP_AUTOCLOSE, &autoclose, sizeof(autoclose)); | |||
/* Send the first message. This will create the association. */ | /* Send the first message. This will create the association. */ | |||
memset(&outmessage, 0, sizeof(outmessage)); | memset(&outmessage, 0, sizeof(outmessage)); | |||
outmessage.msg_name = &loop2; | outmessage.msg_name = &loop2; | |||
outmessage.msg_namelen = sizeof(loop2); | outmessage.msg_namelen = sizeof(loop2); | |||
outmessage.msg_iov = &out_iov; | outmessage.msg_iov = &out_iov; | |||
outmessage.msg_iovlen = 1; | outmessage.msg_iovlen = 1; | |||
outmessage.msg_iov->iov_base = message; | outmessage.msg_iov->iov_base = message; | |||
outmessage.msg_iov->iov_len = strlen(message) + 1; | outmessage.msg_iov->iov_len = strlen(message) + 1; | |||
bytes_sent = test_sendmsg(sk1, &outmessage, 0, strlen(message)+1); | ||||
test_sendmsg(sk1, &outmessage, 0, strlen(message)+1); | ||||
/* Initialize inmessage for all receives. */ | /* Initialize inmessage for all receives. */ | |||
big_buffer = test_malloc(REALLY_BIG); | big_buffer = test_malloc(REALLY_BIG); | |||
memset(&inmessage, 0, sizeof(inmessage)); | memset(&inmessage, 0, sizeof(inmessage)); | |||
iov.iov_base = big_buffer; | iov.iov_base = big_buffer; | |||
iov.iov_len = REALLY_BIG; | iov.iov_len = REALLY_BIG; | |||
inmessage.msg_iov = &iov; | inmessage.msg_iov = &iov; | |||
inmessage.msg_iovlen = 1; | inmessage.msg_iovlen = 1; | |||
inmessage.msg_control = NULL; | inmessage.msg_control = NULL; | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 3 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |