Menu

com2tcp and hub4com issue

Help
2012-08-20
2013-05-20
  • anthony barrera

    anthony barrera - 2012-08-20

    Hello,

    When I run com2tcp or hub4com to connect to any IP address with the port number 2304, the call to "connect()" seems to change the destination port number from 2304 to 9, which is the linux discard port. Of course the connection is discarded. I cant seem to find any explanation for this, if anyone knows why this is happening I would appreciate the information, thank you - Anthony

     
  • anthony barrera

    anthony barrera - 2012-08-23

    The following change to com2tcp.cpp resolved my issue.

      if (pPort) {
        struct servent *pServEnt;

        pServEnt = getservbyname(pPort, pProtoName);

        sn.sin_port = htons((u_short)atoi(pPort)); //pServEnt ? pServEnt->s_port : htons((u_short)atoi(pPort));
      }

     

Log in to post a comment.