亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tcp.lst

?? 基于51單片機和RTL8019以太網控制器的嵌入式以太網控制程序。
?? LST
?? 第 1 頁 / 共 5 頁
字號:
 728   5                                              conxn[index].state = STATE_TIME_WAIT;
 729   5      //                                      if (debug) PrintStr("TCP: Entered TIME_WAIT state\r");
 730   5      
 731   5                                              conxn[index].state = STATE_CLOSED;
C51 COMPILER V8.02   TCP                                                                   09/21/2006 20:16:32 PAGE 13  

 732   5                                                      InerClose(index);  // Free up connection
 733   5                                              just_closed = TRUE;
 734   5                                      }
 735   4                                              else
 736   4                                              {
 737   5                                                      // He has not ACK'd my FIN.  This happens when there is a simultaneous
 738   5                                                      // close - I got his FIN but he has not yet ACK'd my FIN
 739   5                                                      conxn[index].state = STATE_CLOSING;
 740   5      //                                              if (debug) PrintStr("TCP: Entered CLOSING state\r");
 741   5                                              }
 742   4                                      }
 743   3                                      else if (packACK == conxn[index].my_sequence)
 744   3                                      {
 745   4                                              // He has ACK'd my FIN but has not sent a FIN yet himself
 746   4                                              conxn[index].state = STATE_FIN_WAIT_2;
 747   4                                      //      if (debug) PrintStr("TCP: Entered FIN_WAIT_2 state\r");
 748   4                                      }
 749   3                                      break;
 750   3                              case STATE_FIN_WAIT_2:
 751   3                                      // He may still be sending me data - should process it
 752   3                                      conxn[index].his_sequence += data_len;
 753   3                                      conxn[index].his_ack = packACK;
 754   3      
 755   3                                      if (pRxdnet->tcpframe.control & FLG_FIN)
 756   3                                      {
 757   4                                              conxn[index].his_sequence++; // For his FIN flag
 758   4                                              tcp_send(&TCPSend,FLG_ACK, 20, index);
 759   4                                              conxn[index].state = STATE_TIME_WAIT;
 760   4      //                                      if (debug) PrintStr("TCP: Entered TIME_WAIT state\r");
 761   4                                      //      conxn[index].state = STATE_CLOSED;
 762   4                                                      InerClose(index); // Free up struct area
 763   4                                              just_closed = TRUE;
 764   4                                      }
 765   3                                      break;
 766   3                              case STATE_TIME_WAIT:
 767   3                                      // With this code, should not get here
 768   3                                              //因為在進入FIN_WAIT_2后這邊的連接直接進入CLOSED
 769   3      //                                      if (debug) PrintStr("TCP: Oops! In TIME_WAIT state\r");
 770   3                                      break;
 771   3                              case STATE_CLOSING:
 772   3                                      // Simultaneous close has happened. I have received his FIN
 773   3                                      // but he has not yet ACK'd my FIN.  Waiting for ACK.
 774   3                                      // Will not receive data in this state
 775   3                                      conxn[index].his_ack = packACK;
 776   3      
 777   3                                      if (packACK == conxn[index].my_sequence)
 778   3                                      {
 779   4                                                      conxn[index].state = STATE_TIME_WAIT;
 780   4       //                                     if (debug) PrintStr("TCP: Entered TIME_WAIT state\r");
 781   4      
 782   4                                              // Do not send any response to his ACK
 783   4                              //              conxn[index].state = STATE_CLOSED;
 784   4                                                      InerClose(index);  // Free up struct area
 785   4                                              just_closed = TRUE;
 786   4                                      }
 787   3                                      break;
 788   3                              case STATE_SYN_SENT:
 789   3                                      //這些代碼用于當連接為客戶端是的狀況
 790   3                                      //// If incoming segment contains SYN and  ACK, then handle
 791   3                                      if ((pRxdnet->tcpframe.control & FLG_SYN) && (pRxdnet->tcpframe.control & FLG_ACK))
 792   3                                      {
 793   4                                              conxn[index].my_sequence++;             //for my SYN
C51 COMPILER V8.02   TCP                                                                   09/21/2006 20:16:32 PAGE 14  

 794   4                                              conxn[index].ip.words[0]= pRxdnet->ipframe.sourceip[0];
 795   4                                              conxn[index].ip.words[1]= pRxdnet->ipframe.sourceip[1];
 796   4                                              conxn[index].port = pRxdnet->tcpframe.sourceport;
 797   4                                              conxn[index].localport=LOCAL_PORT;
 798   4                                              conxn[index].state = STATE_ESTABLISHED;
 799   4                                              conxn[index].socket_type = CLIENT;
 800   4                                              conxn[index].his_sequence = 1 + packSeq;
 801   4                                              conxn[index].his_ack = packACK;
 802   4                                              tcp_send(&TCPSend,FLG_ACK, 20, index);          // Send ACK
 803   4                                              //調用OnConnect()函數
 804   4                                              (* conxn[index].connect)();
 805   4                                      }
 806   3                                      break;
 807   3                              default:
 808   3      //                                      if (debug) PrintStr("TCP: Error, no handler\r");
 809   3                                      break;
 810   3                      }
 811   2                      // This is for debug, to see when conxn closes
 812   2                      if (just_closed)
 813   2                      {
 814   3                              just_closed = FALSE;
 815   3                              if (debug) PrintStr("TCP: Closed connection ");
 816   3                      }
 817   2      
 818   2              }
 819   1      }
 820          
 821          
 822          
 823          //------------------------------------------------------------------------
 824          // This runs every 0.5 seconds.  If the other end has not ACK'd
 825          // everyting we have sent, it re-sends it.  To save RAM space, we
 826          // regenerate a segment rather than keeping a bunch of segments
 827          // hanging around eating up RAM.  A connection should not be in an
 828          // opening or closing state when this timer expires, so we simply
 829          // send a reset.
 830          //
 831          //      If a connection is in the ESTABLISHED state when the timer expires
 832          // then we have just sent a web page so re-send the page
 833          //2006-02-13:修改重傳的次數及時間
 834          //------------------------------------------------------------------------
 835          void tcp_retransmit()
 836          {
 837   1         unsigned char nr;
 838   1         // Scan through all active connections
 839   1         for (nr = 0; nr < NO_CONNECTION; nr++)
 840   1         {
 841   2            if ((conxn[nr].ip.dwords != 0) && (conxn[nr].timer))
 842   2            {
 843   3               // Decrement the timer and see if it hit 0
 844   3               conxn[nr].timer--;
 845   3               if (conxn[nr].timer == 0)
 846   3               {
 847   4                               
 848   4                  // Socket just timed out. If we are not in ESTABLISHED state
 849   4                  // something is amiss so send reset and close connection
 850   4                  if (conxn[nr].state != STATE_ESTABLISHED)
 851   4                  {
 852   5                                      // Send reset and close connection
 853   5                                      if (debug) PrintStr("TCP: Timeout, sending reset\r");
 854   5                                      tcp_send(&TCPSend,FLG_RST, 20, nr);
 855   5                                      InerClose(nr);
C51 COMPILER V8.02   TCP                                                                   09/21/2006 20:16:32 PAGE 15  

 856   5                                      return;
 857   5                  }
 858   4                  else
 859   4                  {
 860   5                     // Socket is in ESTABLISHED state. First make sure his
 861   5                     // ack number is not bogus.
 862   5                     if (conxn[nr].his_ack > conxn[nr].my_sequence)
 863   5                     {
 864   6                                              // Send reset and close connection
 865   6                                              if (debug) PrintStr("TCP: Timeout, sending reset2\r");
 866   6                                              tcp_send(&TCPSend,FLG_RST, 20, nr);
 867   6                                              InerClose(nr);
 868   6                                              return;
 869   6                     }
 870   5                     // We always increment our sequence number immediately
 871   5                                 // after sending, so the ack number from the other end
 872   5                                 // should be equal to our sequence number.  If it is less,
 873   5                                 // it means he lost some of our data.
 874   5              //       if (conxn[nr].his_ack < conxn[nr].my_sequence)
 875   5                      //         {
 876   5                                 else
 877   5                                 {
 878   6                                         if(conxn[nr].pUnAcked->bUsed)
 879   6                                         {
 880   7                                                      conxn[nr].retries++;
 881   7                                                      if (conxn[nr].retries <= RESENDCOUNT)
 882   7                                                      {
 883   8                                              // The only thing we send is a web page, and it looks
 884   8                                              // like other end did not get it, so resend
 885   8                                              // but do not increase my sequence number
 886   8                                              if (debug) PrintStr("TCP: Timeout, resending data\r");
 887   8                                                              tcp_senddata(&TCPSend,conxn[nr].pUnAcked->pBuf,conxn[nr].pUnAcked->iLen+20,nr,1);
 888   8                                                              //重置保活定時器
 889   8                                                              conxn[nr].aty_timer = INACTIVITY_TIME;
 890   8                                                      }
 891   7                                                      else
 892   7                                                      {
 893   8                                                              conxn[nr].retries = 0;
 894   8                                                              if (debug) PrintStr("TCP: Giving up, sending reset\r");
 895   8                                                              // Send reset and close connection
 896   8                                              tcp_send(&TCPSend,FLG_RST, 20, nr);
 897   8                                                              InerClose(nr);
 898   8                                      }
 899   7                                         }
 900   6                     }
 901   5                              }
 902   4               }
 903   3            }
 904   2              }
 905   1      }
 906          
 907          
 908          
 909          
 910          //------------------------------------------------------------------------
 911          // 該函數每隔2個小時執行,向對方發送一個ARP請求,如果搜到arp echo,則接著發送
 912          //一個ack,該ack序號為正常ack-1

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
自拍偷拍亚洲欧美日韩| 精品毛片乱码1区2区3区| 91亚洲资源网| 色综合久久久久综合| 99久久国产综合精品色伊 | 国产成人免费视频网站| 国产一区二区在线视频| 国产ts人妖一区二区| 粉嫩久久99精品久久久久久夜 | 久久久午夜电影| 国产三级欧美三级| 亚洲精品免费在线| 日本欧洲一区二区| 色欧美88888久久久久久影院| 日韩亚洲欧美中文三级| 最新久久zyz资源站| 亚洲va欧美va人人爽| www.av亚洲| 在线电影院国产精品| 欧美精品一区二区蜜臀亚洲| 国产免费成人在线视频| 午夜精品久久久久久久| 国产.欧美.日韩| 日韩免费在线观看| 日韩综合一区二区| 色女孩综合影院| 亚洲欧洲日产国码二区| 国产精品一区二区在线观看网站| 精品视频一区二区不卡| 综合激情成人伊人| eeuss鲁片一区二区三区在线看| 宅男噜噜噜66一区二区66| 亚洲在线视频网站| 91官网在线免费观看| 亚洲成人精品在线观看| 欧美日韩国产小视频在线观看| 亚洲欧美激情插| 在线免费一区三区| 日韩二区三区四区| 久久亚洲二区三区| 成人自拍视频在线| 青椒成人免费视频| 国产午夜精品在线观看| 成人动漫一区二区在线| 一区2区3区在线看| 久久先锋影音av| 99精品国产视频| 午夜精品久久久久久久99水蜜桃 | 国产很黄免费观看久久| 国产精品福利一区二区三区| 在线亚洲+欧美+日本专区| 日韩精品亚洲一区| 国产欧美一区二区精品秋霞影院 | 亚洲乱码中文字幕| 日韩一区二区三区视频| 成人av在线一区二区三区| 亚洲国产精品久久人人爱蜜臀| 日韩一二三区不卡| 色吊一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 亚洲欧洲另类国产综合| 久久综合久色欧美综合狠狠| 欧美色手机在线观看| 福利一区二区在线观看| 男男成人高潮片免费网站| 亚洲激情自拍视频| 欧美高清在线视频| 精品久久久久久久久久久久包黑料 | 日本高清不卡在线观看| 国产 日韩 欧美大片| 麻豆极品一区二区三区| 亚洲成人1区2区| 亚洲综合网站在线观看| 国产精品传媒入口麻豆| 国产欧美一区二区三区在线老狼| 久久久综合视频| 久久久高清一区二区三区| 精品国产青草久久久久福利| 日韩精品一区在线| 欧美xxxx老人做受| 久久久精品免费网站| 精品国产精品网麻豆系列| 欧美日韩国产一级二级| 日韩一区二区在线看片| 久久婷婷成人综合色| 欧美国产日韩一二三区| 国产精品视频免费看| 日本美女一区二区| 激情欧美一区二区| www.欧美.com| 欧美日韩国产经典色站一区二区三区| 欧美视频在线观看一区二区| 欧美色偷偷大香| 国产亚洲一区二区三区在线观看| 精品99一区二区| 一区二区三区波多野结衣在线观看| 亚洲尤物视频在线| 国产精品综合一区二区三区| 99久久精品一区| 亚洲精品一区二区三区影院| 亚洲欧洲无码一区二区三区| 麻豆91在线看| 欧美专区亚洲专区| 久久蜜桃av一区精品变态类天堂 | 欧美日韩视频第一区| 国产亚洲成av人在线观看导航| 一区二区三区在线免费视频| 国内一区二区在线| 精品视频在线看| 亚洲美女屁股眼交3| 国产精品亚洲午夜一区二区三区 | 日本sm残虐另类| 在线观看日韩毛片| 中文字幕乱码久久午夜不卡| 日日夜夜免费精品视频| 欧美性淫爽ww久久久久无| 久久影视一区二区| 精品一区二区日韩| 欧美一区二区在线免费播放| 亚洲综合网站在线观看| 色综合久久久久久久久| 日韩伦理免费电影| 99re成人精品视频| 国产精品久久影院| 99精品视频在线播放观看| 国产精品视频一二| 91在线视频18| 寂寞少妇一区二区三区| 久久综合九色综合97婷婷女人| 久久99精品国产.久久久久 | 日本欧美韩国一区三区| 日韩欧美一级片| 国产成人在线观看免费网站| 国产精品福利一区二区三区| 99麻豆久久久国产精品免费| 亚洲高清不卡在线| 欧美大片在线观看一区二区| 国产不卡在线播放| 亚洲午夜久久久久久久久久久| 色婷婷激情久久| 久久99国产精品麻豆| 中文字幕一区二区三区av| 欧美午夜精品一区二区蜜桃 | 日韩精品影音先锋| 97超碰欧美中文字幕| 人禽交欧美网站| 中文字幕在线免费不卡| 欧美精品久久久久久久多人混战| 国产成人无遮挡在线视频| 亚洲同性同志一二三专区| 欧美日本精品一区二区三区| 成人综合婷婷国产精品久久蜜臀| 亚洲成人在线免费| 亚洲另类色综合网站| 国产日韩亚洲欧美综合| 欧美一区二区三区的| 欧美日韩一区在线| 色综合色综合色综合| 成人app在线| 国产精品正在播放| 免费观看91视频大全| 欧美精品第一页| 国产一区二区三区免费播放| 丝袜美腿成人在线| 亚洲6080在线| 亚洲国产cao| 五月婷婷综合激情| 午夜久久福利影院| 亚洲自拍另类综合| 亚洲一级二级三级| 亚洲午夜免费电影| 偷偷要91色婷婷| 久久精品国产在热久久| 蜜臀av亚洲一区中文字幕| 日本不卡视频一二三区| 免费在线欧美视频| 国产麻豆日韩欧美久久| 国产成人自拍网| 91丝袜高跟美女视频| 欧美三级三级三级| 欧美大片拔萝卜| 亚洲精品一区二区三区影院 | 天堂久久久久va久久久久| 国产亚洲精品久| 日韩影院免费视频| 精品视频色一区| 亚洲综合久久av| 欧美午夜寂寞影院| 亚洲另类在线视频| 色婷婷综合久久| 一级做a爱片久久| 欧美性受xxxx黑人xyx| 国产亚洲一二三区| 丝袜a∨在线一区二区三区不卡| 东方欧美亚洲色图在线| 日韩一区二区电影| 亚洲超碰97人人做人人爱| 99r国产精品| 中文字幕欧美三区| 国产精品99久|