(E-Mail Removed) (Serge Blokhin) said:
>I have an app which is listening specific port for incoming
>connections.
>I run it on AIX ,HPUX, Solaris it all worked fine, but on linux (RH
>7.2 ) it's not working.
>When i run netstat -l it shows that my app is listening 25115 port,
>which is kinda strange 'cause I wanted it to listen 7010...
You found out correct, this is because of endian issues.
So, showing the 7010 in hexadecimal gives 1B62. With the endian
mismatch, this gets interpreted as 621B, which is 25115 decimal.
To solve this for port numbers, the applications should always use
htons() to transform the port number from the host byte order to
network byte order. Similarly, some data retrieved form the network
interface functions must be converted back to host byte order with
ntohs(). These practices make the same code work on all platforms.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)