I am trying to get two PDAs to talk to each other and pass
files back and forth. They are set up on a wireless
network already. (AdHoc).

I have set up the Server using eVC and it appears to be in
a listening mode. (I have it time out after 20 seconds)
And everything on that end looks fine.

On the Client side, I have the following lines of code:

sock = socket (AF_INET, SOCK_STREAM, 0);
if ((ph = gethostbyname (HostName)) == NULL)
MessageBox (NULL, TEXT("Error", szAppName, MB_OK);

HostName is just a character string set to the name of the
Server PDA.

Everytime I run it, it says it cannot find the host. No
matter what I do.

Any ideas? I have the hardcoded IP address and wanted to
just code that into the SOCKADDR_IN struct. But there
does not seem to be an easy way to do this.

Please help.

Ben

Re: Winsock gethostbyname not working by Amit

Amit
Fri Oct 03 14:36:59 CDT 2003

Whats the value returned by GetlastError()?
Are you taking care of unicode?...Try gethostbyname(_T("Hostname"))

Regards
Amit
"Ben" <benburns2010@yahoo.com> wrote in message
news:0f7201c3892e$9c1ccd20$a101280a@phx.gbl...
> I am trying to get two PDAs to talk to each other and pass
> files back and forth. They are set up on a wireless
> network already. (AdHoc).
>
> I have set up the Server using eVC and it appears to be in
> a listening mode. (I have it time out after 20 seconds)
> And everything on that end looks fine.
>
> On the Client side, I have the following lines of code:
>
> sock = socket (AF_INET, SOCK_STREAM, 0);
> if ((ph = gethostbyname (HostName)) == NULL)
> MessageBox (NULL, TEXT("Error", szAppName, MB_OK);
>
> HostName is just a character string set to the name of the
> Server PDA.
>
> Everytime I run it, it says it cannot find the host. No
> matter what I do.
>
> Any ideas? I have the hardcoded IP address and wanted to
> just code that into the SOCKADDR_IN struct. But there
> does not seem to be an easy way to do this.
>
> Please help.
>
> Ben



Re: Winsock gethostbyname not working by Ben

Ben
Fri Oct 03 09:38:57 CDT 2003


>-----Original Message-----
>Whats the value returned by GetlastError()?

I am getting 11001. This is with WSAGetLastError and
GetLastError().

>Are you taking care of unicode?...

Ok, still new to this, not sure. What should I be looking
for?

Try gethostbyname(_T("Hostname"))

Did this, with no difference at all.

Thanks,

Ben
>
>Regards
>Amit
>"Ben" <benburns2010@yahoo.com> wrote in message
>news:0f7201c3892e$9c1ccd20$a101280a@phx.gbl...
>> I am trying to get two PDAs to talk to each other and
pass
>> files back and forth. They are set up on a wireless
>> network already. (AdHoc).
>>
>> I have set up the Server using eVC and it appears to be
in
>> a listening mode. (I have it time out after 20 seconds)
>> And everything on that end looks fine.
>>
>> On the Client side, I have the following lines of code:
>>
>> sock = socket (AF_INET, SOCK_STREAM, 0);
>> if ((ph = gethostbyname (HostName)) == NULL)
>> MessageBox (NULL, TEXT("Error", szAppName, MB_OK);
>>
>> HostName is just a character string set to the name of
the
>> Server PDA.
>>
>> Everytime I run it, it says it cannot find the host. No
>> matter what I do.
>>
>> Any ideas? I have the hardcoded IP address and wanted
to
>> just code that into the SOCKADDR_IN struct. But there
>> does not seem to be an easy way to do this.
>>
>> Please help.
>>
>> Ben
>
>
>.
>