- 多宿性(multi-homing)
多宿是指一个SCTP 端点可以通过多个IP地址到达,这样两个SCTP端点在建立了关联后,数据可以通过不 同的物理通路进行传送。也就是说,当一条通路坏掉后,可以通过另一条通路到达对端。
- 多流性(multi-streaming)
由于采用多个流进行传输而且各个流相互独立,这样当一个流中的数据包需要重传,其他流中的数据可以 继续传输, 解决了在TCP单流中容易出现的队头阻塞现象(head-of-line).
- 安全机制
- 一对一
- 一对多
|
int main() /* Create an SCTP TCP-Style Socket */ /* Specify that a maximum of 5 streams will be available per socket */ /* Specify the peer endpoint to which we'll connect */ /* Connect to the server */ /* Enable receipt of SCTP Snd/Rcv Data via sctp_recvmsg */ /* Read and emit the status of the Socket (optional step) */ printf("assoc id = %d\n", status.sstat_assoc_id ); /* Expect two messages from the peer */ for (i = 0 ; i < 2 ; i++) { in = sctp_recvmsg( connSock, (void *)buffer, sizeof(buffer), if (in > 0) { } /* Close our socket and exit */ return 0; |
|
int main() /* Create SCTP TCP-Style Socket */ /* Accept connections from any interface */ ret = bind( listenSock, (struct sockaddr *)&servaddr, sizeof(servaddr) ); /* Specify that a maximum of 5 streams will be available per socket */ /* Place the server socket into the listening state */ /* Server loop... */ /* Await a new client connection */ /* New client socket has connected */ /* Grab the current time */ /* Send local time on stream 0 (local time stream) */ /* Send GMT on stream 1 (GMT stream) */ /* Close the client connection */ } return 0; |
- 多宿性(multi-homing)
多宿是指一个SCTP 端点可以通过多个IP地址到达,这样两个SCTP端点在建立了关联后,数据可以通过不 同的物理通路进行传送。也就是说,当一条通路坏掉后,可以通过另一条通路到达对端。
- 多流性(multi-streaming)
由于采用多个流进行传输而且各个流相互独立,这样当一个流中的数据包需要重传,其他流中的数据可以 继续传输, 解决了在TCP单流中容易出现的队头阻塞现象(head-of-line).
- 安去机制
- 一对一
- 一对多
|
int main() /* Create an SCTP TCP-Style Socket */ /* Specify that a maximum of 5 streams will be available per socket */ /* Specify the peer endpoint to which we'll connect */ /* Connect to the server */ /* Enable receipt of SCTP Snd/Rcv Data via sctp_recvmsg */ /* Read and emit the status of the Socket (optional step) */ printf("assoc id = %d\n", status.sstat_assoc_id ); /* Expect two messages from the peer */ for (i = 0 ; i < 2 ; i++) { in = sctp_recvmsg( connSock, (void *)buffer, sizeof(buffer), if (in > 0) { } /* Close our socket and exit */ return 0; |
|
int main() /* Create SCTP TCP-Style Socket */ /* Accept connections from any interface */ ret = bind( listenSock, (struct sockaddr *)&servaddr, sizeof(servaddr) ); /* Specify that a maximum of 5 streams will be available per socket */ /* Place the server socket into the listening state */ /* Server loop... */ /* Await a new client connection */ |
转载于:https://my.oschina.net/alphajay/blog/4727
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/226536.html原文链接:https://javaforall.net
