I am having problems getting the correct host name using
NetLibGetHostByName. I have seen on this group someone mention that the
first address in addressList[0] can be zero; in my instance I just seem to
get a random address.
There is the code snipit at the bottom of this post. I'm using Tungsten T
with BlueTooth for the connection. I can hard code the address and connect
ok.
Any ideas?
Just for background; I want to use bluetooth to a Nokia 6310 and GPRS from
phone to server. I am going to use Net library functions, open library,
get ip address, open and connect socket, send and receive data. Does this
sound sane?
Dave
NetHostInfoPtr hostInfoP;
Err error = 0;
if(hostInfoBufP)
{
//get host information
hostInfoP = NetLibGetHostByName(gNetRefNum, hostName, hostInfoBufP,
timeout, &error);
if(hostInfoP != 0)
{
IPaddressP = (NetIPAddr *) hostInfoBufP->addressList[0];
myAddress = NetNToHL(*IPaddressP);
}
}
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/