You can create a socket file using socket() system call avialable under <sys/socket.h>
example,
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
You can refer to this socket file using the sockfd .
This is same as the file descriptor, and you can use read(), write() system calls to read and write from the socket
Comment