Operating System - HP-UX
1753718 Members
5769 Online
108799 Solutions
New Discussion

Re: Traying to create a socket

 
David Cuarenta_1
New Member

Traying to create a socket

I need an exemple how to use the connect() function, I can't fill the
parameters for the struct sockaddr_in

I have created the socket() but i can't assign the IP-address for the Host
where the service is defined.

I'm traying to use gethostbyname() and getservbyname()

Thanks so much From Reynosa Mexico.

Davis.
1 REPLY 1
Paul Hite_2
Frequent Advisor

Re: Traying to create a socket

The book "UNIX Network Programming" by Rich Stevens has examples of the connect
system call and much more. I really recommend the book. But you can also
download the source code for the examples for free from Rich Stevens' home
page.