Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I need to report back to an HTTP response which channel was used in a mobile device to transfer the data.

I.e Was the handheld connected to Wifi, GSM, HSPA or BlueTooth for example when the inital HTTP request was made.

The website needs to know how the information was returned.

Any help or pointers would be appreciated as this is not my area of expertise.

Paul
Posted

You can't. It's that simple.

The website will get no information at all on what physical network type was used. It cannot see anything below the transport (TCP) and network layers (IP). What you're talking about is the DataLink and Physical layers of the OSI model, which web servers never get any data on.
 
Share this answer
 
Hello Dave,

Thanks for that but it is not the website end I am concerned about.
I am doing a POST to the website and constructing a string to POST, the web developer has set a field to hold channel infomation, I have to stuff that field with the channel information from the handheld device.

What I need is to open a web request and then query what channel was used to make the connection and then add that into my string variable at the right place, then stream that string to the website via the web request.

I'm using OpenNetCf.net to try and find out about the connection used but it keeps returning null, do I have to itterate through every connection in connection manager to identify the active one before I can identify it, I can't see another way.

Any help would be appreciated.

Paul
 
Share this answer
 
Comments
Dave Kreskowiak 9-Jun-14 16:04pm    
First, this is NOT a solution, so don't post it as one. Hit the 'Have a question or comment' button on thepost you're replying to.

On the client end, you'd have to get the IP address of the server your sending the request to then look that address up in the route table. In Win32, there's the function called GetBestInterface() where you pass in the IP address of the destination and get back an index into the Interfaces (what's you're calling a 'channel') table.

http://msdn.microsoft.com/en-us/library/aa365920%28vs.85%29.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900