PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
sockets not seeing the world :(
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
sockets not seeing the world :(
![]() |
sockets not seeing the world :( |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi
I have been programming for years but am just starting to develop mobile apps for wm5. im using visual studio 2008, but did start my development on visual studio 2003. I am trying to implement some parts of an ftp client into a compact app using sockets. Within vs2003 this worked fine both in an emulator and running the app on a device via the activesync link, but when i created a cab file for the app and installed it on my device it would not connect to the network, failing on the connect command (connecting to an endpoint) I have since moved to vs2008 and i am now unable to get my application to connect to the outside world both on the emulator and the device. I have tried opening the web browser on the emulator and am unable to access a web page, which tells me it has no internet connection. thats fair enough i can see why that wont work but when i install the app onto my device i have tried opening a normal data connection and wifi, both allow me to open web pages, but neither allow my socket to connect anyone got any ideas?? Pete |
|
|
|
#2 |
|
Guest
Posts: n/a
|
You didn't tell us what sort of network we're talking about. There's also
the issue that, on a phone, when using the phone network to make your network connections, that isn't connected 100% of the time. When you launch the browser, it will try to connect, using the Connection Manager, to a suitable network, including the phone network, if available, before actually trying to open the page you're visiting. So, I think what's going on is that basically you're trying to run an outbound socket connection with no network adapter in the computer, if you will. OpenNETCF, www.opennetcf.com, has a wrapper for the connection manager which you can use to more-easily tell it to connect you to The Internet (a network named that), so that you can access your server. If you're using .NET CF 3.5, there's a built-in interface to it there. Paul T. <MoosePR@gmail.com> wrote in message news:1984b449-c54e-45e6-b2f7-34bfc35d3d08@s33g2000pri.googlegroups.com... > Hi > > I have been programming for years but am just starting to develop > mobile apps for wm5. im using visual studio 2008, but did start my > development on visual studio 2003. > > I am trying to implement some parts of an ftp client into a compact > app using sockets. Within vs2003 this worked fine both in an emulator > and running the app on a device via the activesync link, but when i > created a cab file for the app and installed it on my device it would > not connect to the network, failing on the connect command (connecting > to an endpoint) > > I have since moved to vs2008 and i am now unable to get my application > to connect to the outside world both on the emulator and the device. I > have tried opening the web browser on the emulator and am unable to > access a web page, which tells me it has no internet connection. thats > fair enough i can see why that wont work but when i install the app > onto my device i have tried opening a normal data connection and wifi, > both allow me to open web pages, but neither allow my socket to > connect > > anyone got any ideas?? > > Pete |
|
|
|
#3 |
|
Guest
Posts: n/a
|
yeah im setting up the endpoint and then connecting my socket to said
endpoint. i thought there must be something that i would have to do to allow the app to know which network connection to use. I was of course assuming that the os would be clever enough to realize that an outgoing network connection was trying to get out and therefore open up the default (3G connection) or use the current (wireless/3G). I am using VS2008 so i have the 3.5 framework available!! any example code as to initializing the network adapter would be a great help if it is not too much trouble!!! Thanks for the reply Pete |
|
|
|
#4 |
|
Guest
Posts: n/a
|
yeah im setting up the endpoint and then connecting my socket to said
endpoint. i thought there must be something that i would have to do to allow the app to know which network connection to use. I was of course assuming that the os would be clever enough to realize that an outgoing network connection was trying to get out and therefore open up the default (3G connection) or use the current (wireless/3G). I am using VS2008 so i have the 3.5 framework available!! any example code as to initializing the network adapter would be a great help if it is not too much trouble!!! Thanks for the reply Pete |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Sorry, I'm a Windows CE guy, not really a Windows Mobile guy, so I don't
have Connection Manager samples laying around. Can't be that hard, though. Check the .NET CF 3.5 help or do a search on MSDN. Paul T. <MoosePR@gmail.com> wrote in message news:6e206987-4bbc-419b-8362-0c71687558bc@w4g2000prd.googlegroups.com... > yeah im setting up the endpoint and then connecting my socket to said > endpoint. > > i thought there must be something that i would have to do to allow the > app to know which network connection to use. I was of course assuming > that the os would be clever enough to realize that an outgoing network > connection was trying to get out and therefore open up the default (3G > connection) or use the current (wireless/3G). > > I am using VS2008 so i have the 3.5 framework available!! any example > code as to initializing the network adapter would be a great help if > it is not too much trouble!!! > > Thanks for the reply > > Pete > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
You need to use the connection manager API. There is no managed wrapper in
the CF even in 3.5 so you'll have to code this yourself or use the SDF as they have written a wrapper. My advice is do *not* assume connection manager will make the right choice of a connection for you. Use the GUID and select the network connection as you know what connection it should be using. This is where the connection manager falls flat not to mention there are some situations where it is almost impossible for it to select the correct network connection profile. -- Simon Hart Visual Developer - Device Application Development MVP http://simonrhart.blogspot.com "MoosePR@gmail.com" wrote: > yeah im setting up the endpoint and then connecting my socket to said > endpoint. > > i thought there must be something that i would have to do to allow the > app to know which network connection to use. I was of course assuming > that the os would be clever enough to realize that an outgoing network > connection was trying to get out and therefore open up the default (3G > connection) or use the current (wireless/3G). > > I am using VS2008 so i have the 3.5 framework available!! any example > code as to initializing the network adapter would be a great help if > it is not too much trouble!!! > > Thanks for the reply > > Pete > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
Thanks For your input guys!!
If theres any sample code or if i can get some idea which part of the msdn library to start reading with regards to selecting and initialising a network connection on a compact framework device. I have experience in using sockets but only on normal computers and so they just use the current network connection Thanks again Pete |
|
|
|
#8 |
|
Guest
Posts: n/a
|
I pointed you to OpenNETCF in my first message...
Paul T. <MoosePR@gmail.com> wrote in message news:a9059907-2597-4155-9e23-e812f02e231d@k13g2000hse.googlegroups.com... > Thanks For your input guys!! > > If theres any sample code or if i can get some idea which part of the > msdn library to start reading with regards to selecting and > initialising a network connection on a compact framework device. > > I have experience in using sockets but only on normal computers and so > they just use the current network connection > > Thanks again > > Pete |
|
|
|
#9 |
|
Guest
Posts: n/a
|
indeed you did and i have looked Paul. there is an ftp class and a
network class in there The ftp doesnt seem to do anything like i was imagining. i was expecting it to be a bit simpler (maybe me being lazy) theres no real connect/auth/send/rec type functions in there and if it has to be done manually i would be better off carrying on the way i was Unless the network sockets type part of the openNETCF automatically checks and opens connections as and when there needed that wont be much use to me either. I have asked the same thing on the msdn forums and a chappy on there pointed me in the direction of the connection manager api. this appears to do what i need to do although i can only find related code in C++ not vb.net!! http://msdn2.microsoft.com/en-us/library/aa457829.aspx All good fun Pete |
|
|
|
#10 |
|
Guest
Posts: n/a
|
No, I'm not suggesting that you wrap the FTP stuff, but that you use the
Connection Manager wrapper in the Smart Device Framework to connect before your FTP stuff does its thing. Paul T. <MoosePR@gmail.com> wrote in message news:83c2d4fa-c1c8-4617-93cc-4d6b7a89bbba@t54g2000hsg.googlegroups.com... > indeed you did and i have looked Paul. there is an ftp class and a > network class in there > > The ftp doesnt seem to do anything like i was imagining. i was > expecting it to be a bit simpler (maybe me being lazy) theres no real > connect/auth/send/rec type functions in there and if it has to be done > manually i would be better off carrying on the way i was > > Unless the network sockets type part of the openNETCF automatically > checks and opens connections as and when there needed that wont be > much use to me either. > > I have asked the same thing on the msdn forums and a chappy on there > pointed me in the direction of the connection manager api. this > appears to do what i need to do although i can only find related code > in C++ not vb.net!! http://msdn2.microsoft.com/en-us/library/aa457829.aspx > > All good fun > > Pete |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

