⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 client.lst

📁 在89C51上实现TCPIP协议
💻 LST
字号:
C51 COMPILER V7.07   CLIENT                                                                04/20/2004 18:04:40 PAGE 1   


C51 COMPILER V7.07, COMPILATION OF MODULE CLIENT
OBJECT MODULE PLACED IN .\out\client.obj
COMPILER INVOKED BY: F:\Keil\C51\BIN\C51.EXE src\client.c BROWSE DEBUG OBJECTEXTEND PRINT(.\lst\client.lst) OBJECT(.\out
                    -\client.obj)

stmt level    source

   1          /*
   2           * Copyright (C) 2002 by TechiZ. All rights reserved.
   3           *
   4           * This program was written in Korean(Comment and some more).
   5           *
   6           * This program was developed by TechiZ(The Company name).
   7           * TechiZ want to share this program with you who loves the 8051 & the TCP/IP.
   8           * 
   9           * You MUST DOWNLOAD THIS CODE from TechiZ Homepage.
  10           * You DO NOT USE THIS CODE FOR COMMERCIAL PURPOSE.
  11           * This code is ONLY FREE FOR THE STUDY.
  12           * If you want more, send me E-mail.
  13           *
  14           * E-mail: techiz@techiz.com
  15           * ( Subject is : [T89C51RD2 & TinyTCP] bla~ bla bla.... )
  16           *
  17           * Homepage: http://www.techiz.com
  18           * 
  19           * You DO NOT DELETE THIS COPYRIGHT MESSAGE IN THE USING OF THIS CODE.
  20           *
  21           * In the using of this code, TechiZ does NOT GUARANTEE ABOUT WORKING WITHOUT ERROR.
  22           */
  23          
  24          //  捞 橇肺弊伐篮 Linux 肚绰 Cygwin俊辑 哪颇老窍咯 角青茄促. 
  25          //弊矾搁 8051苞 捞歹齿阑 烹秦辑 皋矫瘤甫 林绊 罐绰促.
  26          
  27          #include <sys/types.h>
*** WARNING C318 IN LINE 27 OF src\client.c: can't open file 'sys/types.h'
  28          #include <sys/socket.h>
*** WARNING C318 IN LINE 28 OF src\client.c: can't open file 'sys/socket.h'
  29          #include <stdio.h>
  30          
  31          #include <netinet/in.h>
*** WARNING C318 IN LINE 31 OF src\client.c: can't open file 'netinet/in.h'
  32          #include <arpa/inet.h>
*** WARNING C318 IN LINE 32 OF src\client.c: can't open file 'arpa/inet.h'
  33          
  34          #include <unistd.h>
*** WARNING C318 IN LINE 34 OF src\client.c: can't open file 'unistd.h'
  35          #define PORT    9999
  36          
  37          int main()
  38          {
  39   1              int sockfd;
  40   1              int len;
  41   1              int i;
  42   1              char ch;
  43   1              struct sockaddr_in address; /*AF_INET 档皋牢俊辑 林家绰 sockaddr_in捞扼 阂府绰 备炼眉甫 */
*** ERROR C230 IN LINE 43 OF SRC\CLIENT.C: 'sockaddr_in': unknown struct/union/enum tag
  44   1                                              /*荤侩窍咯 疙矫茄促. 捞巴篮 netinet/in.h 俊 沥狼茄促*/
  45   1              int result;
  46   1              int cmd;
  47   1              char buf[1600];
  48   1          
C51 COMPILER V7.07   CLIENT                                                                04/20/2004 18:04:40 PAGE 2   

  49   1              i = 0;
  50   1              
  51   1              sockfd = socket( AF_INET, SOCK_STREAM, 0);/*家南阑 积急茄促.*/
*** ERROR C202 IN LINE 51 OF SRC\CLIENT.C: 'AF_INET': undefined identifier
  52   1              address.sin_family = AF_INET;
*** ERROR C202 IN LINE 52 OF SRC\CLIENT.C: 'address': undefined identifier
  53   1              address.sin_addr.s_addr = inet_addr( "210.107.198.178" );
*** ERROR C202 IN LINE 53 OF SRC\CLIENT.C: 'address': undefined identifier
  54   1              address.sin_port = htons(PORT);
*** ERROR C202 IN LINE 54 OF SRC\CLIENT.C: 'address': undefined identifier
  55   1          
  56   1              len = sizeof(address);
*** ERROR C202 IN LINE 56 OF SRC\CLIENT.C: 'address': undefined identifier
  57   1      
  58   1              result = connect( sockfd, (struct sockaddr *)&address, len);
  59   1          
  60   1              if ( result == -1) {
  61   2                      perror("oops: client1");
  62   2                      exit(1);
  63   2              }
  64   1              printf("Connection Established..\n");
  65   1              while(1) {
  66   2                      i++;
  67   2                      //usleep(100000);
  68   2                      write(sockfd,"I'm CSL..!" ,80);
  69   2                      printf("\t send number : %d \r\n",i);
  70   2                      memset(buf, 0, 512);
  71   2                      len = read(sockfd, buf, 1600);
  72   2                      if (len > 0){
  73   3                      printf("%s\r\n",buf);
  74   3                      }      
  75   2              }
  76   1              
  77   1              close(sockfd);
  78   1      }

C51 COMPILATION COMPLETE.  5 WARNING(S),  6 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -