Home All Groups Group Topic Archive Search About

using winsock over an adhoc wireless connection

Author
13 Jun 2009 6:06 PM
MrGarbage
I have 2 simple Windows C++ client and server applications that
communicate with
each other using sockets. The current implementation is wired ethernet
and a crossover cable (2 seperate PCs).

I need to migrate this to a Wireless Ad-hoc network connection.
I have successfully established an ad-hoc wireless connection.

I'm a little unclear as to how to progress...

In the wired implementaion I simply used a static IP address for
each of the two computers and I'm able to connect using those.

In this implementation I cannot be certain that a static IP is unique
to my
two machines.

How can I establish a socket connection to my other PC without knowing
it's
IP address?

I guess I could use static IPs and build in the security into the Ad-
Hoc connection itself
so that only my two machines can be members...

Any suggestions appreciated!

Thanks
Mark

Author
14 Jun 2009 2:53 PM
Tae Song
"MrGarbage" <garb***@meftechno.com> wrote in message
news:83108ae5-540a-4461-abcc-6f6e16e6db56@x1g2000prh.googlegroups.com...
> I have 2 simple Windows C++ client and server applications that
> communicate with
> each other using sockets. The current implementation is wired ethernet
> and a crossover cable (2 seperate PCs).
>
> I need to migrate this to a Wireless Ad-hoc network connection.
> I have successfully established an ad-hoc wireless connection.
>

If you've made a ad-hoc wireless connection, then IP address have/should be
sorted out.


> I'm a little unclear as to how to progress...
>
> In the wired implementaion I simply used a static IP address for
> each of the two computers and I'm able to connect using those.
>
> In this implementation I cannot be certain that a static IP is unique
> to my
> two machines.
>
> How can I establish a socket connection to my other PC without knowing
> it's
> IP address?
>

You need to make a call to the OS to query what IP address it has (is
assigned.)

You replace the static IP address you were using in a wired configuration
with the IP address that the OS says it has obtained through the process of
forming an ad-hoc wireless connection.


Show quoteHide quote
> I guess I could use static IPs and build in the security into the Ad-
> Hoc connection itself
> so that only my two machines can be members...
>
> Any suggestions appreciated!
>
> Thanks
> Mark
>