Click to See Complete Forum and Search --> : Application hangs during gethostbyaddr and connect function


abinash.1986
March 19th, 2010, 03:38 AM
Hi,

I have created an SDI application in which i am creating a client-server application using Socket Programming.I am connecting with multiple PCs.My application works fine if the remote PC gets connected.But when the remote PC is ShutDown the application hangs during gethostbyaddr function and takes some time to come out of it.If my client application is not running in remote PCs then it gets hang during connect function.Can anybody please help me out of this or suggest a different way to do it.Its urgent.

Thanks

hoxsiew
March 19th, 2010, 07:44 AM
Sounds like a resolver issue. Is there any reason why you need the hostname from the addr? Many resolvers don't even bother adding reverse lookup records since so many addresses are assigned from DHCP these days.

Why are you calling gethostbyaddr at all after the connection is established?