摘要:
#include <sys/socket.h>int socket(int domain, int type, int protocol);socket的三个形参搭配整理如下:------------------------------------------------------------------TCP、UDP socket: 最常用的socket,不解释tcp_socket = socket(AF_INET, SOCK_STREAM, 0);udp_socket = socket(AF_INET, SOCK_DGRAM, 0);struct sockaddr_in in 阅读全文
摘要:
一、time函数 #include<time.h>time_ttime(time_t*calptr);返回距计算机元年的秒数一旦取得这种以秒计的很大的时间值后,通常要调用另一个时间函数将其变换为人们可读的时间和日期#include <time.h>//calendar time into a broken-down time expressed as UTCstruct tm *gmtime(const time_t *calptr);//converts the calendar time to the local time, taking into account 阅读全文