One traditional way to write network servers is to have the main server block on accept(), waiting for a connection. Once a connection comes in, the s Read More
posted @ 2016-07-17 13:52 suonikeyinsu Views(250) Comments(0) Diggs(0) Edit
#include <sys/types.h> #include <sys/socket.h> int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); 描述: The accept() system call is used Read More
posted @ 2016-07-17 13:44 suonikeyinsu Views(341) Comments(0) Diggs(0) Edit
#include <sys/types.h> #include <sys/socket.h> int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); 描述: The connect() system call Read More
posted @ 2016-07-17 13:40 suonikeyinsu Views(301) Comments(0) Diggs(0) Edit
#include <sys/types.h> #include <sys/socket.h> int listen(int sockfd, int backlog); 描述: listen() marks the socket referred to by sockfd as a passive s Read More
posted @ 2016-07-17 13:34 suonikeyinsu Views(220) Comments(0) Diggs(0) Edit
#include <sys/types.h> #include <sys/socket.h> int socket(int domain, int type, int protocol); 返回值: On success, a file descriptor for the new socket i Read More
posted @ 2016-07-17 13:30 suonikeyinsu Views(295) Comments(0) Diggs(0) Edit
#include <sys/types.h> #include <sys/socket.h> int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); 返回值: On success, zero is returned Read More
posted @ 2016-07-17 13:26 suonikeyinsu Views(273) Comments(0) Diggs(0) Edit