Printable Version of Topic

Click here to view this topic in its original format

AMIP Community _ SDK Support _ ac_getSrcPort returns same value as ac_getDestPort?

Posted by: jdh Mar 24 2010, 12:30 AM

Serge, now that getting a long playlist works I have noticed one oddity wih ac_getSrcPort and ac_getDestPort, and possibly also ac_getSrcHost and ac_getDestHost.

I modified getplaylist.cpp as follows to demonstrate my problem:

CODE

  // Here we should have a playlist
  char title[AC_BUFFER_SIZE];

  EnterCriticalSection(&cs_list);
  int size = ac_get_plsize();
  for (int i = 0; i < size; i++) {
    memset(title, 0, AC_BUFFER_SIZE);
    if (ac_get_title(i, title)) {
      printf("%s\n", title);
    }
  }
  LeaveCriticalSection(&cs_list);

  // Src versus Dest issue
  char sHost[AC_BUFFER_SIZE];
  char dHost[AC_BUFFER_SIZE];
  ac_getSrcHost(sHost);
  ac_getDestHost(dHost);
  printf("\nac_getSrcPort returned: %d\n", ac_getSrcPort());
  printf("ac_getDestPort returned: %d\n", ac_getDestPort());
  printf("ac_getSrcHost returned: %s\n", sHost);
  printf("ac_getDestHost returned: %s\n", dHost);

  ac_remove_event_listener(SERVER_HOST, SERVER_PORT);


As mention in ac.h ac_getSrcPort should return 60334 and ac_getDestPort should return 60333, However running getplaylist (after the playlist listing) I get:

ac_getSrcPort returned: 60333
ac_getDestPort returned: 60333
ac_getSrcHost returned: 127.0.0.1
ac_getDestHost returned: 127.0.0.1

Any idea why both Src and Dest are the same?

Sorry about this, but I promise this is the only other issue I've found sad.gif

Thanks, Jdh

Posted by: Serge Mar 24 2010, 01:20 AM

These functions return values from the ac.ini. If there is no ac.ini, then default values are returned. Default values are the same and are hardcoded.

So the problem is that ac.ini is missing.

Posted by: jdh Mar 26 2010, 10:52 PM

QUOTE(Serge @ Mar 23 2010, 08:20 PM) *

These functions return values from the ac.ini. If there is no ac.ini, then default values are returned. Default values are the same and are hardcoded.

So the problem is that ac.ini is missing.


Thanks Serge, forgot about the ac.ini it's probably not there. Or at the very least not setup correctly!

Thanks again, Jdh

Powered by Invision Power Board
© Invision Power Services