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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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));
}