This is a discussion on changed port within the Linux Networking forums, part of the Linux Forums category; Hi All, I am new in linux so the question may be easy, I have an app which is listening ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi All,
I am new in linux so the question may be easy, 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... If i try to connect to the linux box on 25115 port i get the connection but non on 7010. So it looks like somehow linux changes listening port for my app... Can somebody explain me why it is happening? Thanks Serge |
|
|||
|
Serge Blokhin wrote:
> Hi All, > I am new in linux so the question may be easy, > 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... > If i try to connect to the linux box on 25115 port i get the > connection but non on 7010. So it looks like somehow linux changes > listening port for my app... > Can somebody explain me why it is happening? > Thanks > Serge Hi, on some Linux Systems, you are not allowed to use the registered ports. Port 7010 is used for ups-onlinet 7010/tcp # onlinet uninterruptable power supplies ups-onlinet 7010/udp # onlinet uninterruptable power supplies Alex |
|
|||
|
Alex Harsch <infodude@gmx.de> wrote in message news:<c5n5d9$10vd$1@ulysses.news.tiscali.de>...
Hi Alex, > Hi, > > on some Linux Systems, you are not allowed to use the registered ports. Port > 7010 is used for > ups-onlinet 7010/tcp # onlinet uninterruptable power supplies > ups-onlinet 7010/udp # onlinet uninterruptable power supplies > > > Alex Well, tried other ports, same thing. Something changes ports... Serge |
|
|||
|
Serge Blokhin wrote:
> Alex Harsch <infodude@gmx.de> wrote in message > news:<c5n5d9$10vd$1@ulysses.news.tiscali.de>... > > Hi Alex, > >> Hi, >> >> on some Linux Systems, you are not allowed to use the registered ports. >> Port 7010 is used for >> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies >> ups-onlinet 7010/udp # onlinet uninterruptable power supplies >> >> >> Alex > > Well, tried other ports, same thing. > Something changes ports... > Serge Hi Serge, have you already tried a private port? The Dynamic and/or Private Ports are those from 49152 through 65535. They are for private use, and I guess your system will let you use one of these. Regards, Alex |
|
|||
|
Hi Alex,
I think I know what's going.... I guess it all comes to playing with big-endian/little-endian stuff. so my problem has nothing to do with linux itself... Thanks for your help anyway. Serge > Serge Blokhin wrote: > > > Alex Harsch <infodude@gmx.de> wrote in message > > news:<c5n5d9$10vd$1@ulysses.news.tiscali.de>... > > > > Hi Alex, > > > >> Hi, > >> > >> on some Linux Systems, you are not allowed to use the registered ports. > >> Port 7010 is used for > >> ups-onlinet 7010/tcp # onlinet uninterruptable power supplies > >> ups-onlinet 7010/udp # onlinet uninterruptable power supplies > >> > >> > >> Alex > > > > Well, tried other ports, same thing. > > Something changes ports... > > Serge > Hi Serge, > > have you already tried a private port? > The Dynamic and/or Private Ports are those from 49152 through 65535. > > They are for private use, and I guess your system will let you use one of > these. > Regards, Alex |
|
|||
|
sergey.blokhin@ca.com (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) |