Ticket #3873: multiple-udp-socket.2.patch

File multiple-udp-socket.2.patch, 2.5 KB (added by Dave <megadave@…>, 13 years ago)
  • libs/libmythlivemedia/groupsock/GroupsockHelper.cpp

    diff -ur mythtv.orig/libs/libmythlivemedia/groupsock/GroupsockHelper.cpp mythtv/libs/libmythlivemedia/groupsock/GroupsockHelper.cpp
    old new  
    3434// By default, use INADDR_ANY for the sending and receiving interfaces:
    3535netAddressBits SendingInterfaceAddr = INADDR_ANY;
    3636netAddressBits ReceivingInterfaceAddr = INADDR_ANY;
     37netAddressBits ReceivingSocketAddr = INADDR_ANY;
    3738
    3839static void socketErr(UsageEnvironment& env, char* errorMsg) {
    3940        env.setResultErrMsg(errorMsg);
     
    9394#else
    9495  if (port.num() != 0 || ReceivingInterfaceAddr != INADDR_ANY) {
    9596#endif
    96     MAKE_SOCKADDR_IN(name, ReceivingInterfaceAddr, port.num());
     97    MAKE_SOCKADDR_IN(name, ReceivingSocketAddr, port.num());
    9798    if (bind(newSocket, (struct sockaddr*)&name, sizeof name) != 0) {
    9899      char tmpBuffer[100];
    99100      sprintf(tmpBuffer, "bind() error (port number: %d): ",
     
    560561      testAddr.s_addr = our_inet_addr("228.67.43.91"); // arbitrary
    561562      Port testPort(15947); // ditto
    562563     
     564      ReceivingSocketAddr = INADDR_ANY;
     565
    563566      sock = setupDatagramSocket(env, testPort);
    564567      if (sock < 0) break;
    565568     
  • libs/libmythlivemedia/groupsock/include/GroupsockHelper.hh

    diff -ur mythtv.orig/libs/libmythlivemedia/groupsock/include/GroupsockHelper.hh mythtv/libs/libmythlivemedia/groupsock/include/GroupsockHelper.hh
    old new  
    7979// are INADDR_ANY (i.e., 0), specifying the default interface.)
    8080extern netAddressBits SendingInterfaceAddr;
    8181extern netAddressBits ReceivingInterfaceAddr;
     82extern netAddressBits ReceivingSocketAddr;
    8283
    8384// Allocates a randomly-chosen IPv4 SSM (multicast) address:
    8485netAddressBits chooseRandomIPv4SSMAddress(UsageEnvironment& env);
  • libs/libmythtv/iptv/iptvfeederudp.cpp

    diff -ur mythtv.orig/libs/libmythtv/iptv/iptvfeederudp.cpp mythtv/libs/libmythtv/iptv/iptvfeederudp.cpp
    old new  
    6969    if (!InitEnv())
    7070        return false;
    7171   
     72    ReceivingSocketAddr = our_inet_addr(parse.host().latin1());
     73
    7274    Groupsock *socket = new Groupsock(*_live_env, addr, parse.port(), 0);
    7375    if (!socket)
    7476    {