Adhoc Mode, CAsyncSockets

Adhoc Mode, CAsyncSockets

Post by tarnes.. » Tue, 15 Jul 2003 13:20:19



Good Evening Everyone,

        I posted a message last week about having problems setting up
two iPaqs to communicate to each other in Adhoc mode.  After setting
both up with static IPs we were able to use CAsyncSocket to zip any
type of file back and forth between the two iPaqs in Adhoc mode.
However a new problem has presented itself.

        When we start our application and start sending data back and
forth through threads everything is great.  However, one of the iPaqs
is hooked up to a cellular phone which needs to obtain an internet
connection and then route to our server.  Using the CMHelper example
we brought up the internet connection however whenever we specify the
address of our server it tries to use the wireless network cards.
However if we obtain the internet connection first we can send data
back and forth through the internet and the wireless cards.  If we
close the internet connection and then bring it back up again,
everything is routed through the wireless cards.

The question then is:
How do you specify that information for a socket should be sent
through COM1, and not through wireless cards?  

I have spent many hours searching the google groups and the internet
for the solution but the closest I have come is the CreateFile and
WriteFile commands which will not help us in our task.  Any guidance,
direction or even better one or two lines of code would greatly be
appreciated.

Thanks and Kind Regards,

Troy

 
 
 

Adhoc Mode, CAsyncSockets

Post by Paul G. Tobey [eMVP » Wed, 16 Jul 2003 00:27:26


When you bind() your socket, you can control to which network 'adapter' it
is connected.  If you want to send via some RF Ethernet card, bind the
socket to that card's IP address.  The same basic operation should work for
binding the socket to the 'modem' or whatever else provides network
transport functionality.

Paul T.


Quote:> Good Evening Everyone,

> I posted a message last week about having problems setting up
> two iPaqs to communicate to each other in Adhoc mode.  After setting
> both up with static IPs we were able to use CAsyncSocket to zip any
> type of file back and forth between the two iPaqs in Adhoc mode.
> However a new problem has presented itself.

> When we start our application and start sending data back and
> forth through threads everything is great.  However, one of the iPaqs
> is hooked up to a cellular phone which needs to obtain an internet
> connection and then route to our server.  Using the CMHelper example
> we brought up the internet connection however whenever we specify the
> address of our server it tries to use the wireless network cards.
> However if we obtain the internet connection first we can send data
> back and forth through the internet and the wireless cards.  If we
> close the internet connection and then bring it back up again,
> everything is routed through the wireless cards.

> The question then is:
> How do you specify that information for a socket should be sent
> through COM1, and not through wireless cards?

> I have spent many hours searching the google groups and the internet
> for the solution but the closest I have come is the CreateFile and
> WriteFile commands which will not help us in our task.  Any guidance,
> direction or even better one or two lines of code would greatly be
> appreciated.

> Thanks and Kind Regards,

> Troy


 
 
 

1. Adhoc Mode and CSockets

Hello Everyone,

        I am hoping someone out there might be able to help me
understand Adhoc mode and how to program for it.  I currently have two
iPaqs both with wireless cards and I need the ability to send back and
forth data between them every 5 to 10 minutes (linksys cards,
802.11b).  I understand the CSocket class and how to do this via a
modem, but with Adhoc mode I am currently stuck.  I have a feeling we
have not set up the iPaqs right to begin with, which may be half of my
problems.  Here is what has happened thus far.

1.) When we turn the iPaqs on they see eachother and are both using
the same mac address???  Shouldn't there be different mac addresses?

2.) We have tried setting to static IP addresses, 192.168.0.1 and
192.168.0.2.  Default Gateway of 255.255.255.0.  Didn't change
anything and was not able to see the other unit as they still had the
same mac address.

Am I missing something, or does is sound like it is setup correctly?
If so, should I be using a different class the CSocket to do the
connection in Adhoc mode?

Thanks in advance

Troy Arnestad

2. HELP! WinQVT/NET v3.97: comm_open: bind()-error

3. CAsyncSocket::OnReceive after CAsyncSocket::OnClose

4. re-install

5. Re-entering listening mode with CAsyncSocket

6. WD 120 GB HD shows up as 32GB on XPpro Install

7. adhoc wireless network

8. Win95 won't see added videoDRAM :( Advice?

9. Orinoco PC Card Gold Adhoc Network setup problem in XP

10. SAFE MODE SAFE MODE SAFE MODE - HELP

11. COMPACT mode in 7.1 'Classic' - Where did the REAL compact mode go?

12. user-mode audio driver ontop of another user-mode audio driver

13. post process mode?current post process mode?