○C语言实的串行通信接口程序
case FD-WRITE:/*网络事件:写准备好*/
for (i=0;i
#include
#include
#include
#define USERPORT 3333/*用户定义端口号,与客户机相同*/
#define HOST-IP-ADDR 166.111.8.80/*我们的主机地址*/
main(int argc, char **argv)
{
char buf;/*buffer for sending and receiving data*/
struct sockaddr-in client;/*client address information*/
struct sockaddr-in server;/*server address information*/
int s;/*socket for accepting connections*/
int ns;/*socket connected to client*/
int namelen;/*length of client name*/
int pktlen;/*length of packet received or sended*/
if ((s = socket(AF-INET,SOCK-STREAM, 0))
转自: 仅仅学术交流与学习之用,非商业之目的.
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论