gsoap插件之wsdd主动广播发送hello、bye

Invoking WS-Discovery Operations:

1.发送hello加入一个网络

soap_wsdd_Hello(soap,
  SOAP_WSDD_MANAGED,    // or SOAP_WSDD_ADHOC for ad-hoc mode
  "to address",         // "http(s):" URL, or "soap.udp:" UDP, or TCP/IP address
  soap_wsa_rand_uuid(soap), // a unique message ID
  NULL,
  "my address",         // where they can find me for WS-Discovery
  "wsdd:DiscoveryProxy",// Types: I'm a DP
  NULL,                 // Scope
  NULL,                 // MatchBy
  NULL,                 // XAddrs
  1);                   // MDVersion

2.发送bye离开一个网络
soap_wsdd_Bye(soap,
  SOAP_WSDD_MANAGED,    // or SOAP_WSDD_ADHOC for ad-hoc mode
  "to address",         // "http(s):" URL, or "soap.udp:" UDP, or TCP/IP address
  soap_wsa_rand_uuid(soap), // a unique message ID
  "my address",         // where they can find me for WS-Discovery
  "wsdd:DiscoveryProxy",// Types: I'm a DP
  NULL,                 // Scope
  NULL,                 // MatchBy
  NULL,                 // XAddrs
  1);                   // MDVersion

to address格式: soap.udp://<组播地址>:<端口号>

你可能感兴趣的:(gsoap插件之wsdd主动广播发送hello、bye)