Ports in FTP

csharp Sweden
  • 13 years ago
    Hi,

    I'm currently working on a very simple, lighweight FTP server built for passive connections. This requires the FTP server to send the "PASV" command telling the client to what IP and port connections can be made to on the server for data transfer. From my "research" I found the syntax for the PASV command to be as follows:

    "PASV n1,n2,n3,n4,p1,p2" where n1-n4 is the IP address and p1,p2 is the port number. However, I havent been able to find any information on how to convert a decimal port number into the two "hex octets". If I wish to tell the client to connect to port 1234, what would my p1 and p2 to be?

    -Thanks!





Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski