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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? intro.html

?? Beej的socket教材
?? HTML
字號:
<HTML><HEAD><TITLE>Intro</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.70"><LINKREL="HOME"TITLE="Beej's Guide to Network Programming"HREF="index.html"><LINKREL="PREVIOUS"TITLE="Beej's Guide to Network Programming"HREF="index.html"><LINKREL="NEXT"TITLE="What is a socket?"HREF="theory.html"><METAHTTP-EQUIV="Content-Type"CONTENT="text/html; charset=utf-8"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Beej's Guide to Network Programming</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="index.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="theory.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="intro">1. Intro</A></H1><P>Hey!  Socket programming got you down?  Is this stuff just alittle too difficult to figure out from the <BCLASS="command">man</B>pages?  You want to do cool Internet programming, but you don't havetime to wade through a gob of <TTCLASS="type">struct</TT>s trying to figure outif you have to call <TTCLASS="function">bind()</TT> before you<TTCLASS="function">connect()</TT>, etc., etc.</P><P>Well, guess what!  I've already done this nasty business, and I'mdying to share the information with everyone!  You've come to the rightplace.  This document should give the average competent C programmer theedge s/he needs to get a grip on this networking noise.</P><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN46">1.1. Audience</A></H2><P>This document has been written as a tutorial, not a reference.  Itis probably at its best when read by individuals who are just startingout with socket programming and are looking for a foothold.  It iscertainly not the <EM>complete</EM> guide to socketsprogramming, by any means.</P><P>Hopefully, though, it'll be just enough for those man pages tostart making sense... <TTCLASS="computeroutput">:-)</TT></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN52">1.2. Platform and Compiler</A></H2><P>The code contained within this document was compiled on a Linux PCusing Gnu's <BCLASS="command">gcc</B> compiler.  It should, however, buildon just about any platform that uses <BCLASS="command">gcc</B>.  Naturally,this doesn't apply if you're programming for Windows--see the <AHREF="intro.html#windows">section on Windows programming</A>, below.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN58">1.3. Official Homepage</A></H2><P>This official location of this document is at California StateUniversity, Chico, at <TTCLASS="computeroutput"><AHREF="http://www.ecst.csuchico.edu/~beej/guide/net/"TARGET="_top">http://www.ecst.csuchico.edu/~beej/guide/net/</A></TT>.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="solaris">1.4. Note for Solaris/SunOS Programmers</A></H2><P>When compiling for Solaris or SunOS, you need to specify someextra command-line switches for linking in the proper libraries.  Inorder to do this, simply add "<TTCLASS="computeroutput">-lnsl -lsocket-lresolv</TT>" to the end of the compile command, likeso:</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="screen">&#13;    <TTCLASS="prompt">$</TT> <BCLASS="command">cc -o server server.c -lnsl -lsocket -lresolv</B></PRE></TD></TR></TABLE><P>If you still get errors, you could try further adding a"<TTCLASS="computeroutput">-lxnet</TT>" to the end of that commandline.  I don't know what that does, exactly, but some people seem toneed it.</P><P>Another place that you might find problems is in the call to<TTCLASS="function">setsockopt()</TT>.  The prototype differs from that onmy Linux box, so instead of:</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="programlisting">&#13;	int yes=1;</PRE></TD></TR></TABLE><P>enter this:</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="programlisting">&#13;	char yes='1';</PRE></TD></TR></TABLE><P>As I don't have a Sun box, I haven't tested any of the aboveinformation--it's just what people have told me through email.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="windows">1.5. Note for Windows Programmers</A></H2><P>I have a particular dislike for Windows, and encourage you to tryLinux, BSD, or Unix instead.  That being said, you can still use thisstuff under Windows.</P><P>First, ignore pretty much all of the system header files I mentionin here.  All you need to include is:</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="programlisting">&#13;    #include &#60;winsock.h&#62; </PRE></TD></TR></TABLE><P>Wait!  You also have to make a call to<TTCLASS="function">WSAStartup()</TT> before doing anything else with thesockets library.  The code to do that looks something like this:</P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="programlisting">&#13;    #include &#60;winsock.h&#62;    {        WSADATA wsaData;   // if this doesn't work        //WSAData wsaData; // then try this instead        if (WSAStartup(MAKEWORD(1, 1), &#38;wsaData) != 0) {            fprintf(stderr, "WSAStartup failed.\n");            exit(1);        } </PRE></TD></TR></TABLE><P>You also have to tell your compiler to link in the Winsocklibrary, usually called <TTCLASS="filename">wsock32.lib</TT> or<TTCLASS="filename">winsock32.lib</TT> or somesuch.  Under VC++, this can bedone through the <TTCLASS="computeroutput">Project</TT> menu, under<TTCLASS="computeroutput">Settings...</TT>.  Click the<TTCLASS="computeroutput">Link</TT> tab, and look for the box titled"Object/library modules".  Add "wsock32.lib" to that list.</P><P>Or so I hear.</P><P>Finally, you need to call <TTCLASS="function">WSACleanup()</TT> whenyou're all through with the sockets library.  See your online help fordetails.</P><P>Once you do that, the rest of the examples in this tutorial shouldgenerally apply, with a few exceptions.  For one thing, you can't use<TTCLASS="function">close()</TT> to close a socket--you need to use<TTCLASS="function">closesocket()</TT>, instead.  Also,<TTCLASS="function">select()</TT> only works with socket descriptors, notfile descriptors (like <TTCLASS="constant">0</TT> for<TTCLASS="computeroutput">stdin</TT>).</P><P>There is also a socket class that you can use,<TTCLASS="type">CSocket</TT>.  Check your compilers help pages for moreinformation.</P><P>To get more information about Winsock, read the <AHREF="http://tangentsoft.net/wskfaq/"TARGET="_top">Winsock FAQ</A> and go from there.</P><P>Finally, I hear that Windows has no <TTCLASS="function">fork()</TT>system call which is, unfortunately, used in some of my examples.  Maybeyou have to link in a POSIX library or something to get it to work, oryou can use <TTCLASS="function">CreateProcess()</TT> instead.<TTCLASS="function">fork()</TT> takes no arguments, and<TTCLASS="function">CreateProcess()</TT> takes about 48 billion arguments.If you're not up to that, the <TTCLASS="function">CreateThread()</TT> is alittle easier to digest...unfortunately a discussion aboutmultithreading is beyond the scope of this document.  I can only talkabout so much, you know!</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="emailpolicy">1.6. Email Policy</A></H2><P>I'm generally available to help out with email questions so feelfree to write in, but I can't guarantee a response.  I lead a prettybusy life and there are times when I just can't answer a question youhave.  When that's the case, I usually just delete the message.  It'snothing personal; I just won't ever have the time to give the detailedanswer you require.</P><P>As a rule, the more complex the question, the less likely I am torespond.  If you can narrow down your question before mailing it and besure to include any pertinent information (like platform, compiler,error messages you're getting, and anything else you think might help metroubleshoot), you're much more likely to get a response.  For morepointers, read ESR's document, <AHREF="http://www.tuxedo.org/~esr/faqs/smart-questions.html"TARGET="_top">How To AskQuestions The Smart Way</A>.</P><P>If you don't get a response, hack on it some more, try to find theanswer, and if it's still elusive, then write me again with theinformation you've found and hopefully it will be enough for me to helpout.</P><P>Now that I've badgered you about how to write and not write me,I'd just like to let you know that I <EM>fully</EM>appreciate all the praise the guide has received over the years.  It's areal morale boost, and it gladdens me to hear that it is being used forgood! <TTCLASS="computeroutput">:-)</TT>  Thank you!</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN120">1.7. Mirroring</A></H2><P>You are more than welcome to mirror this site, whether publicallyor privately.  If you publically mirror the site and want me to link toit from the main page, drop me a line at<TTCLASS="email">&#60;<AHREF="mailto:beej@piratehaven.org">beej@piratehaven.org</A>&#62;</TT>.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN124">1.8. Note for Translators</A></H2><P>If you want to translate the guide into another language, write meat <TTCLASS="email">&#60;<AHREF="mailto:beej@piratehaven.org">beej@piratehaven.org</A>&#62;</TT> and I'll link to your translation from themain page.</P><P>Feel free to add your name and email address to thetranslation.</P><P>Sorry, but due to space constraints, I cannot host thetranslations myself.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN130">1.9. Copyright and Distribution</A></H2><P>Beej's Guide to Network Programming is Copyright 漏 1995-2001Brian "Beej" Hall.</P><P>This guide may be freely reprinted in any medium provided that itscontent is not altered, it is presented in its entirety, and thiscopyright notice remains intact.</P><P>Educators are especially encouraged to recommend or supply copiesof this guide to their students.</P><P>This guide may be freely translated into any language, providedthe translation is accurate, and the guide is reprinted in itsentirety.  The translation may also include the name and contactinformation for the translator.</P><P>The C source code presented in this document is hereby granted tothe public domain.</P><P>Contact <TTCLASS="email">&#60;<AHREF="mailto:beej@piratehaven.org">beej@piratehaven.org</A>&#62;</TT> for more information.</P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="index.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="theory.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Beej's Guide to Network Programming</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top">&nbsp;</TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">What is a socket?</TD></TR></TABLE></DIV></BODY></HTML>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
免费不卡在线视频| 欧美一区二区播放| 精品欧美一区二区三区精品久久| 中文av一区二区| 日韩国产精品久久| 91亚洲精品一区二区乱码| 日韩精品一区二区三区在线观看| 亚洲欧洲美洲综合色网| 国产美女久久久久| 91精品国产欧美一区二区成人| 中文av字幕一区| 国产精品影视在线观看| 欧美一区二区在线播放| 亚洲精品国产成人久久av盗摄| 狠狠色丁香久久婷婷综| 制服丝袜中文字幕一区| 一区二区在线看| 99免费精品视频| 国产无遮挡一区二区三区毛片日本| 婷婷国产v国产偷v亚洲高清| 在线视频一区二区三| 中文字幕在线一区免费| 成人福利在线看| 久久久九九九九| 狠狠色丁香婷婷综合| 亚洲精品在线网站| 久久99精品国产麻豆不卡| 337p亚洲精品色噜噜噜| 天堂在线亚洲视频| 欧美日韩mp4| 亚洲成人动漫在线免费观看| 欧美色视频一区| 亚洲一区二区三区自拍| 欧洲生活片亚洲生活在线观看| 国产精品美女久久久久高潮| 国产suv一区二区三区88区| 久久女同精品一区二区| 国产一区二区91| 久久久久国产精品麻豆ai换脸| 国产剧情一区在线| 久久久青草青青国产亚洲免观| 国产一区不卡在线| 中文字幕一区二区不卡| 91网站在线播放| 亚洲一区二区成人在线观看| 欧美日韩亚洲综合一区二区三区| 亚洲成人免费在线| 欧美一三区三区四区免费在线看 | 一区二区免费看| 欧美亚洲国产一区在线观看网站| 肉丝袜脚交视频一区二区| 欧美一区二区网站| 国产成人免费视频网站| 国产精品国产三级国产aⅴ原创 | 午夜精品久久一牛影视| 日韩亚洲欧美高清| 国产成人av资源| 一区二区三区日本| 337p亚洲精品色噜噜狠狠| 国产精品一区专区| 一区二区在线电影| 精品久久久网站| 97久久超碰精品国产| 性感美女极品91精品| 久久日一线二线三线suv| 99久久99精品久久久久久| 亚洲3atv精品一区二区三区| 久久亚洲捆绑美女| 欧美怡红院视频| 国产精品一区二区三区四区| 一区二区久久久久| 精品福利二区三区| 色综合久久六月婷婷中文字幕| 无吗不卡中文字幕| 中文字幕+乱码+中文字幕一区| 欧美日韩一区二区在线观看视频 | 日本不卡在线视频| 亚洲欧洲成人av每日更新| 欧美乱妇15p| 成人97人人超碰人人99| 青青草一区二区三区| 国产精品你懂的在线欣赏| 91精品国产丝袜白色高跟鞋| 91丝袜美腿高跟国产极品老师 | 亚洲狠狠爱一区二区三区| 国产色91在线| 欧美久久久久久蜜桃| 99国产精品久久久久久久久久| 无吗不卡中文字幕| 亚洲精品成人精品456| 2欧美一区二区三区在线观看视频| 91福利国产精品| 成人精品gif动图一区| 热久久免费视频| 亚洲成年人影院| 亚洲女同一区二区| 国产精品日韩成人| 久久综合一区二区| 日韩免费看的电影| 这里只有精品电影| 欧美日韩另类一区| 欧美午夜影院一区| 色婷婷综合久久久中文一区二区| 国产精品12区| 国产一区激情在线| 久久疯狂做爰流白浆xx| 欧美aaaaaa午夜精品| 日产国产欧美视频一区精品| 一级做a爱片久久| 亚洲精品第1页| 一区二区三区欧美久久| 亚洲免费观看视频| 亚洲美女屁股眼交3| 亚洲男人的天堂网| 亚洲男人的天堂av| 亚洲成av人片| 日韩精品免费视频人成| 日本不卡高清视频| 麻豆国产精品视频| 国产美女视频一区| 成人在线综合网站| 91亚洲精品久久久蜜桃| 日本韩国一区二区三区| 91色综合久久久久婷婷| 欧美日韩久久久一区| 欧美一二三四区在线| 精品国产成人系列| 中文字幕精品三区| 一区二区国产视频| 日本视频中文字幕一区二区三区| 蜜桃视频在线观看一区二区| 国产在线播放一区二区三区| 国产xxx精品视频大全| 色综合久久中文字幕综合网| 欧美亚洲一区三区| 欧美大片在线观看一区二区| 国产日韩欧美综合一区| 国产精品夫妻自拍| 亚洲尤物在线视频观看| 亚洲va韩国va欧美va精品| 日本不卡1234视频| 成人免费高清视频在线观看| 欧美综合亚洲图片综合区| 4438成人网| 国产精品久久久久久久久免费桃花| 伊人一区二区三区| 美女视频第一区二区三区免费观看网站| 美国一区二区三区在线播放| 成人夜色视频网站在线观看| 欧洲亚洲国产日韩| 国产三级精品在线| 亚洲国产aⅴ成人精品无吗| 蜜桃一区二区三区在线| 91在线观看下载| 91精品国模一区二区三区| 国产精品毛片a∨一区二区三区 | 欧美视频一区二区在线观看| 欧美一区二区三区不卡| 国产精品久久久久久久久免费丝袜 | 亚洲日穴在线视频| 日本aⅴ精品一区二区三区 | 欧美一激情一区二区三区| 中文幕一区二区三区久久蜜桃| 午夜精品aaa| 色综合天天综合网天天狠天天| 欧美一区二区三区在| 18欧美亚洲精品| 国产一区二区三区| 91精品国产综合久久香蕉麻豆| 亚洲欧洲综合另类在线 | 麻豆国产精品777777在线| 色哟哟一区二区| 欧美激情中文字幕| 久久精品国产**网站演员| 91精品1区2区| 亚洲欧洲日韩综合一区二区| 韩国v欧美v日本v亚洲v| 欧美电影在线免费观看| 亚洲日本韩国一区| 国产激情91久久精品导航| 欧美电影免费观看高清完整版| 亚洲一二三四在线观看| 92精品国产成人观看免费 | 99久久久国产精品| 久久精品亚洲国产奇米99| 久久精工是国产品牌吗| 欧美久久久久久久久中文字幕| 有码一区二区三区| 97久久超碰精品国产| 国产精品久久久久久久浪潮网站| 久久精品国产99久久6| 91精品国产入口| 日韩不卡一区二区| 欧美久久久一区| 日韩精品欧美精品| 欧美精品 日韩| 亚洲bdsm女犯bdsm网站| 欧美色手机在线观看| 天天色天天操综合| 欧美精品日韩综合在线|