Boost logo

Boost Users :

From: Andrew Holden (aholden_at_[hidden])
Date: 2008-06-19 08:22:51


Jonathan Locke wrote:
>
> I'm new to Boost and am trying to write a command line networking tool.
> I am currently working in Windows XP SP2 using MS Visual Studio 2005. I
> use the default compiler. I have read a few tutorials and examples on
> using Asio, and thus wrote my app using that information, as well as
> information from the reference library. Currently the problem that I
> have is that I cannot set the port used by the endpoint to the value I
> want - 10540 - it is always set to 11035. I'm not sure why this is, I
> cant find the number 11035 anywhere in the code or documentation so I am
> not sure where it comes from. I have tried to instantiate a new endpoint
> using the IPv4 address as a string and the port number as a short, and
> have also tried to construct a query that specifies the protocol, host
> name, service name (port number in this case) and the numeric_service
> flag.
>
> In either case, when I debug, the port of the endpoint is always 11035,
> no matter what I set it to. I am able to connect to the endpoint, but
> not able to write data to it. I get a "File handle supplied is not valid
> error message". I presume the most likely reason for this is that the
> port 11035 is not open.

Do you mean 11035 or 11305? I ask this because, when I swap the bytes of 10540, I get 11305.

I'm not familiar with ASIO, but I know that in network communication, integers are sent in "network byte order," which is most significant byte first, but Intel processors store integers least significant byte first. Hence the need to swap them.

I'm surprised ASIO isn't swapping the bytes for you. Perhaps one of our resident ASIO gurus could provide some insight on this.

Of course, if you really meant 11035, then kindly disregard this message.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net