0

C Socket programming on Linux

view story
linux-howto

http://stackoverflow.com – I am new to socket programming and linux I could find some code about socket programming I want to use this code to connect to a printer , this code is using gethostbyname function which is responsible for getting hostent I think everything is fine except that I have not the host name I just have an IP address (of printer), So what function should I use to connect to the printer by IP ? this is the code #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> (HowTos)