SCTP Multihoming

后端 未结 3 877
轻奢々
轻奢々 2020-12-23 08:46

I\'ve been developing this simple client - server application with C where the client is just sending random data to the server and the server just listens to what the clien

3条回答
  •  萌比男神i
    2020-12-23 09:08

    I have never tried SCTP but according to this site it supports two models.

    one-to-one style and one-to-many style.

    As far as I understand multihoming works for one-to-one style.

    In order to open a one-to-one style socket you need a call like :

    connSock = socket( AF_INET, SOCK_STREAM, IPPROTO_SCTP );
    

    Note that SOCK_STREAM is different than your SOCK_SEQPACKET

    When you do

    sock = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP)
    

    it seems to open one-to-many style socket which I could not understand if it supports multihoming or not.

    So try your code with SOCK_STREAM parameter.

    Also here is an example that uses SOCK_STREAM.

提交回复
热议问题