diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-22 15:58:05 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-22 15:58:05 +0000 |
| commit | 6ae5882f3cb644369382583f0cea8d6de6dd3da0 (patch) | |
| tree | cf71237ecadbcc8079dae0b9d64bb8086add44d5 /src/SocketCore.h | |
| parent | 6f0fff2a5f584cb944c1e9fde05de0fe6f453ba7 (diff) | |
2010-02-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --bt-lpd-interface option to specify the interface to use
for Local Peer Discovery. LpdMessageDispatcher object now has its
own socket. LpdMessageReceiver's socket is binded to multicast
address to only receive multicast packets.
* src/BtSetup.cc
* src/LpdMessageDispatcher.cc
* src/LpdMessageDispatcher.h
* src/LpdMessageReceiver.cc
* src/LpdMessageReceiver.h
* src/LpdReceiveMessageCommand.cc
* src/LpdReceiveMessageCommand.h
* src/OptionHandlerFactory.cc
* src/SocketCore.cc
* src/SocketCore.h
* src/prefs.cc
* src/prefs.h
* src/usage_text.h
* test/LpdMessageDispatcherTest.cc
* test/LpdMessageReceiverTest.cc
Diffstat (limited to 'src/SocketCore.h')
| -rw-r--r-- | src/SocketCore.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/SocketCore.h b/src/SocketCore.h index a07e264e..b1949cb4 100644 --- a/src/SocketCore.h +++ b/src/SocketCore.h @@ -146,12 +146,22 @@ public: bool isOpen() const { return sockfd != (sock_t) -1; } + void setMulticastInterface(const std::string& localAddr); + void setMulticastTtl(unsigned char ttl); - void joinMulticastGroup(const std::string& ipaddr, uint16_t port); + void setMulticastLoop(unsigned char loop); + + void joinMulticastGroup + (const std::string& multicastAddr, uint16_t multicastPort, + const std::string& localAddr); + void create(int family, int protocol = 0); + void bindWithFamily(uint16_t port, int family, int flags = AI_PASSIVE); + void bind(const std::string& addr, uint16_t port, int flags = AI_PASSIVE); + /** * Creates a socket and bind it with locahost's address and port. * flags is set to struct addrinfo's ai_flags. @@ -389,7 +399,7 @@ int callGetaddrinfo // Collects IP addresses of given inteface iface and stores in // ifAddres. iface may be specified as a hostname, IP address or // interface name like eth0. You can limit the family of IP addresses -// to collect using family argument. +// to collect using family argument. No throw. void getInterfaceAddress (std::vector<std::pair<struct sockaddr_storage, socklen_t> >& ifAddrs, const std::string& iface, int family = AF_UNSPEC); |
