Send data via HTTP using already established connection
I am developing one application which briefly does the following
It create a data session using specific APN(call it APN-1). This APN is different from the default APN(call it APN-2) set in the network setting.
I have used the follwoing API to establish the connection
ConnMgrMapConRef(); and ConnMgrEstablishConnectionSync();
Connection is established successfully.
Now i want to send some data throgh the HTTP . For that i am calling
WebRequest.Create() and passing the URL in the parameter.
When WebRequest.Create() is executed then device starts connection with the default APN(APN-2 as mentioned above). It doesn't check that there is already a active data connection.
So my requirement is that once the connection has been created using specific APN(APN-1). If after that i want to send data through HTTP then it should use the existing connection.I think WebRequest.Create() will always use the default APN for the connection. Is there any way to use the already active data connection to send and receive the data.
Answers
- Hi,
u can send data Using Wininet Fucntions
For ur Reference http://msdn.microsoft.com/en-us/library/aa385473(VS.85).aspx
http://www.dotnetheaven.com/Uploadfile/mahesh/commonWinInetAPI05242005064319AM/commonWinInetAPI.aspx?ArticleID=6335300f-3eda-4199-9888-a71fc138fb73
Azad.S Please remember to mark the replies as answers if they help and unmark them if they provide no help- Marked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Unmarked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Marked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Proposed As Answer byazad123321 Thursday, January 15, 2009 11:30 AM
Hi,
Actually i had try it in win32 C++.. Its working for me (http://69.10.233.10/KB/IP/asyncwininet.aspx)
Am not tried this .net Sample http://aspalliance.com/543_WinInet_vs_Managed_Options..
http://www.velocityreviews.com/forums/t73290-managed-code-ftp-component-reqd.html
http://www.codeguru.com/dbfiles/get_file/CEWinInetCS.zip?id=8551&lbl=CEWININETCS_ZIP&ds=20041102
Just follow the win32 c++ steps..
I hope it wil be helpful
- Marked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Proposed As Answer byss_ss Friday, January 16, 2009 1:37 PM
All Replies
- Hi,
u can send data Using Wininet Fucntions
For ur Reference http://msdn.microsoft.com/en-us/library/aa385473(VS.85).aspx
http://www.dotnetheaven.com/Uploadfile/mahesh/commonWinInetAPI05242005064319AM/commonWinInetAPI.aspx?ArticleID=6335300f-3eda-4199-9888-a71fc138fb73
Azad.S Please remember to mark the replies as answers if they help and unmark them if they provide no help- Marked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Unmarked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Marked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Proposed As Answer byazad123321 Thursday, January 15, 2009 11:30 AM
- Dear Azad,
i am developing this application on Windows Mobile 6.0 and developing it in C#. I have checked that these APIs are supported on the Wm 6.0 platform also.
Have you done this before. Means could you provide some code sample or any web link where i can see how things works. I have tried it today but its not working. I may be missing some thing. I have used the follwoing APIs
InternetOpen()
InternetOpenUrl()
InternetReadFile()
InternetCloseHandle()
in the same sequence. Hi,
Actually i had try it in win32 C++.. Its working for me (http://69.10.233.10/KB/IP/asyncwininet.aspx)
Am not tried this .net Sample http://aspalliance.com/543_WinInet_vs_Managed_Options..
http://www.velocityreviews.com/forums/t73290-managed-code-ftp-component-reqd.html
http://www.codeguru.com/dbfiles/get_file/CEWinInetCS.zip?id=8551&lbl=CEWININETCS_ZIP&ds=20041102
Just follow the win32 c++ steps..
I hope it wil be helpful
- Marked As Answer byGuang-Ming Bian - MSFTMSFT, ModeratorWednesday, January 21, 2009 10:30 AM
- Proposed As Answer byss_ss Friday, January 16, 2009 1:37 PM
- Hi,
Try this sample http://www.codeguru.com/dbfiles/get_file/CEWinInetCS.zip?id=8551&lbl=CEWININETCS_ZIP&ds=20041102
Azad.S Please remember to mark the replies as answers if they help and unmark them if they provide no help- Proposed As Answer byazad123321 Friday, January 16, 2009 2:08 PM
- Hi Azad,
I have seen the example given by you. But this uses the WebRequest.Create method which uses the default APN. But my requirement is to use the already established connection to send receive the data on HTTP. Please have a look at my query again.
Regards
