View previous topic :: View next topic |
Author |
Message |
maxer123
Joined: 26 Oct 2007 Posts: 4
|
Posted: Fri Oct 26, 2007 3:30 pm Post subject: GETDSTPort () |
|
|
Hello,
I have established the WWW serwer, as was presented in example (easy tcp/ip file). OK. It is working fine. The remote web browser takes all information from server. I work on 80 port as (usually).
I tried to start the instruction GETDSTPORT (), but it returns different port number every time the web browser takes information from server. Sometimes the port number is bigger than 64000 (double bytes).
How to change it to return the correct port number ?
Regards,
Peter
|
|
Back to top |
|
|
Arera
Joined: 23 Sep 2007 Posts: 386 Location: Wuppertal, Germany
|
Posted: Wed Dec 12, 2007 2:07 pm Post subject: |
|
|
I´ve got an answer and a question:
My answer:
I experienced the same as you did: large numbers, chanching on every connection. I connect on port 23 to use telnet. Only Port 23 is forwarded in my router, so I´m quiet shure to really use port 23.
As you experienced, everything works fine, we are not to worry about that issue.
My question:
What is the deeper meaning of that getdstport result? |
|
Back to top |
|
|
maxer123
Joined: 26 Oct 2007 Posts: 4
|
Posted: Tue Dec 18, 2007 5:23 pm Post subject: GETDSTPORT |
|
|
Hi,
I would like to know the port number just for testing and security purpose. When I check this port number I will be really sure that application and client are transmitting information using this same port. Of course when communication is established and data are transferred I am able to be sure – good communication is a serious argument.
The port number reported by GETDSTPORT is really completely different from PC network tool – for example <<netstat>>. It is hardly to understand from which “place” this number has been taken. javascript:emoticon('')
Laughing
May be the bug inside routine GETDSTPORT or some inconsistency ?javascript:emoticon('')
Question
Best regards |
|
Back to top |
|
|
lmb_nl
Joined: 13 Nov 2007 Posts: 4
|
Posted: Wed Dec 19, 2007 9:22 am Post subject: |
|
|
Correct me if I'm wrong .....
When you connect to a webserver on port 80, the real connection is established on a different port, because otherwise the webserver wouldn't be able to accept a new connection.
But here it comes . . . (from the manual)
Action
Returns the port number of the peer.
Syntax
Result = GETDSTPort( socket)
Remarks
Result
A WORD variable that is assigned with the port number of the peer or destination port number.
Socket
The socket number.
When you are in server mode, it might be desirable to detect the port number of the connecting client.
You can use this for logging, security, etc.
A webbrowser could use any port to initiate the connection from. IMHO there isn't a fixed port from which you're browser would connect.
It is possible to use a fixed port number (not listening but from which you connect) but you have to program it you're self. Webbrowser won't. |
|
Back to top |
|
|
maxer123
Joined: 26 Oct 2007 Posts: 4
|
Posted: Mon Jan 07, 2008 5:00 pm Post subject: GETDSTPort |
|
|
Hello,
It is really difficult to correct your arguments because you are right !!!
But may you have an idea why the port number reported by Bascom GETDSTPort is different then reported by the other software. I checked the contents of adequate datagrams (during the session) and it is really different.
I suppose that this port number is delivered in decimal form and can be direct presented on LCD. Am I right ? or some extra “manipulation” should be used (hex or MSB translation)
Best regards, |
|
Back to top |
|
|
maxer123
Joined: 26 Oct 2007 Posts: 4
|
Posted: Mon Jan 07, 2008 5:00 pm Post subject: GETDSTPort |
|
|
Hello,
It is really difficult to correct your arguments because you are right !!!
But may you have an idea why the port number reported by Bascom GETDSTPort is different then reported by the other software. I checked the contents of adequate datagrams (during the session) and it is really different.
I suppose that this port number is delivered in decimal form and can be direct presented on LCD. Am I right ? or some extra “manipulation” should be used (hex or MSB translation)
Best regards, |
|
Back to top |
|
|
|