VC简易代理服务器的设计Socket编程.docx
- 文档编号:11755866
- 上传时间:2023-03-31
- 格式:DOCX
- 页数:22
- 大小:41.15KB
VC简易代理服务器的设计Socket编程.docx
《VC简易代理服务器的设计Socket编程.docx》由会员分享,可在线阅读,更多相关《VC简易代理服务器的设计Socket编程.docx(22页珍藏版)》请在冰豆网上搜索。
VC简易代理服务器的设计Socket编程
VC++简易代理服务器的设计(Socket编程)
摘要代理服务器是介于浏览器和Web服务器之间的一台服务器,它的功能是代理网络用户去取得网络信息。
它的工作原理是,接收客户机的数据连接请求,并将请求传给Web服务器;再从Web服务器接收返回的数据,最后把数据传给客户端显示。
本论文讲述的是关于一个简...
摘 要
代理服务器是介于浏览器和Web服务器之间的一台服务器,它的功能是代理网络用户去取得网络信息。
它的工作原理是,接收客户机的数据连接请求,并将请求传给Web服务器;再从Web服务器接收返回的数据,最后把数据传给客户端显示。
本论文讲述的是关于一个简单的代理服务器的实现,在实现中采用客户机/服务器结构模型开发应用程序,基于一般的访问浏览速度慢、效率底、安全功能不强等原因,将以简单、合理、有效为原则;为了方便分析和设计,系统设计中设置不同的状态量用于标识客户机、代理服务器及服务器间的联结状态。
在保证系统基本功能的同时,使用多线程机制使得代理系统有更好的延续性。
此代理系统具有简单,易用,网络化等优点,能够完成一般的HTTP访问代理服务。
关键词:
客户机/服务器结构;多线程;套接字;代理服务器
TheDesignofSimpleProxyServer
Abstract
TheproxyserverisaserverwhichsituatesbetweenthebrowserandaWebserver.It’sprincipleofworkis,itreceivestheconnectionrequestfromtheclient,andhandsdowntherequestedtotheWebserver,thenreceivesdatawhichisreturnedfromtheWebserver.,finallyhandsitdownthedatatotheclient.Intherealization,itadoptsClient/Serverstructuralmodeltodevelopapplication.Becauseofbrowsespeedslow,lowefficientandnotsafeenough,ittakessimple,reasonableandeffectiveastheprinciple.Inthesystemdesign,itsetsdifferentstatestoidentifyclient,proxyserverandtheconnectivestatebetweenservers.Whenthesystem'sbasicfunctionareguaranteed,itusethemultithreadingtoenabletheproxyservertohaveabettercontinuousfeature.Thisproxysystemhasthemeritsuchassimple,easytouseandsoon,anditcancompletetheproxyofgeneralHTTPvisit.
Keywords:
Client/Serverarchitecture;Multithreading;Socket;ProxyServer
本课题的研究方法
此代理服务器系统将是建立在WindowsNT平台上的网络应用程序设计。
由于需要服务器为其他许多称为客户的主机提供服务,而客户主机又可以随时打开和关闭,在选择网络应用程序体系结构时就采用支持这些特点的客户机/服务器结构。
还将运用Windows下网络编程的标准接口WinSock,因为它允许两个或多个应用程序在相同机器上,或者是通过网络相互交流,它是真正协议无关的接口。
为了便于直接使用Windows提供的网络编程接口,我们使用MicrosoftVisualC++6.0作为开发工具,利用MFC类库中提供的两个Socket类CAsyncSocket和Csocket。
使用这两个Socket类,我们可以运用面向对象的方法来进行Socket编程,而且它们还分别在较低和较高层次上封装了WindowsSocketsAPI,为程序员开发Socket程序提供了便利。
目 录
1 引言 1
1.1 课题背景 1
1.2 本课题研究的意义 1
1.3 本课题的研究方法 1
2 理论基础 2
2.1 代理服务器 2
2.2 目前的代理服务技术 3
2.3 SOCKET面向连接的编程模型 4
2.4 WINSOCK库 5
2.4.1 winsock的寻址方式 5
2.4.2 字节顺序 6
2.5 系统基本套接字调用 6
2.5.1 创建和关闭套接字-socket()和closesocket() 6
2.5.2 指定本地地址-bind() 6
2.5.3 设置监听状态-listen() 6
2.5.4 建立套接字连接-connect()和accept() 6
2.5.5 收发数据-send()和recv() 7
3 设计方案 7
3.1 基本函数设计 7
3.2 多线程流程 8
4 服务器的实现 8
4.1 环境创建 8
4.2 功能实现 9
4.2.1 数据变量定义 9
4.2.2 启动代理服务器 10
4.2.3 请求处理过程 11
4.2.4 请求响应 13
4.2.5 关闭服务器 15
4.2.6 控制主函数 15
5 测试结果 15
结 论 17
参考文献 18
致 谢 19
声 明 20
AThesisPresentedtotheDepartmentofEnglishCollegeofInternationalStudies
Abstract
ManypeoplehaveexpressedtheirappreciationofthecolorfulandattractiveadvertisementthatappearinAmericanmagazines.Theyareattractivenotonlyincoloranddesignbutalsointhelanguagetheyusethatseemssopersuasivethatreadersfindthemselvesunabletoresistthetemptation.Aretheresomespeciallinguistictechniquesthatmaketheseadvertisementssoappealingandeffective?
Thisthesisaimsatansweringthisquestionthathasbeenpuzzlingsomanypeople.
Inthispaper,IwillanalyzeadvertisingEnglishfromsyntacticandlexicalperspectiveanddiscusshowthelanguageisplayedinadvertisingEnglish.MyanalysisanddiscussionarebasedonLeech’swork“Englishinadvertising”,whichisquitecompleteandauthoritativeinthisfield.Butthreedecadeshaspassedsinceleechwrotehisbookandhisstudyconfinedmainlytocommercials.Besidesmystudyismainlyonpressadvertising,sotheremustbesomedifferences.I’vecollectedsomeadvertisementsfromsomeBritishandAmericanmagazinesandnewspaperspublishedintheyearof1999asmysamples.Bothquantitativeandnon-quantitativemethodsareusedinmyanalysis,sinceit’salwaystheintuitionthattellstheinvestigatorswhatarethesignificantcategoriestocountandcontrast.Butoccasionally,theresultsofsomemyfrequencyanalysiswillbeusedtobackmystatementsaboutadvertisingEnglish.Later,Iwilldealwithsomelinguisticvariationsinadvertisementsresultingfromdifferentproducts,audienceandaims.Atlast,IwillanalyzesomeofChina’sEnglishadvertisementsandmakeafewrecommendationstoimproveChina’sEnglishadvertisements.
CONTENTS 字
Introduction4
ChapterOne
SyntacticFeatureofAdvertisingEnglish..7
1.1ImperativeSentences......7
1.2InterrogativeSentences...8
1.3DisjunctiveLanguage..9
1.4SplitSentences.....10
ChapterTwo
LexicalFeatureofAdvertisingEnglish....12
2.1Verb..12
2.2Adjective...13
2.3NounandCompound...16
ChapterThree
LanguagePlayinAdvertisingEnglish......19
3.1OrthographicViolation..19
3.2Alliteration.20
3.3FigurativeLanguage..21
3.4Pun.......22
3.5Contradictions......22
3.6PresuppositionandExpectation...23
ChapterFour
SomeCommentsonChineseAdvertisementsinEnglish25
4.1AnAnalysisofChina’sEnglishAdvertisements....25
4.2AfewRecommendationstoImproveChina’sEnglishAdvertisements.27
Conclusion30
Bibliography.32
Bibliography
OgiloyDavid, 1974,“HowtoWritePotentCopy”,GoodyearCo.NewYork
OgiloyDavid,1963,“ConfessionofanAdvertisingMan”,AtheneumPublishers,NewYork
Don.L.E.NilsenandPaceAlleen,“LanguagePlay:
AnIntroductiontoLinguistics”,NewburyHousePublishers,Massachusetts
Leech.G.N,1996,“EnglishinAdvertising”,LongmanPublishingHouse,London
Halliday,1976,“TheLanguageofAdvertising”,TarterPublisher
R.RossiterJohnandLarryPercy,1989,“AdvertisingandPromotionManagement”,McGraw-HillBookCompany,Singapore
StevensPaul,1989,“WeaselWord”s,God’dLittleHelpers,London
FearonRobert,1978,“AdvertisingThatWorks”,ProbusPublishingCo.,Chicago
李中行,1986,《广告英语》,湖南教育出版社。
刘云腾,谢文怡,1987,《广告英语》,上海交通大学出版社。
王安平,1997,《广告用语创作技巧》,中国纺织出版社。
章振邦,1994,《新编英语语法》,上海译文出版社。
周晓,周怡,1998,《现代英语广告》,上海外国语出版社。
消费者购买绿色食品影响因素分析(字)
摘 要:
随着我国人民生活水平的日益提高及农产品供需关系的转变,人们对农产品的需求已经开始朝着多元化和优质化的方向发展,集中表现为从过去对农产品数量的追求转向对农产品质量、卫生、安全方面的追求。
我国的绿色食品事业在这样的大背景下应运而生。
经过十几年的努力,已经获得了长足的发展。
以问卷调查搜集的数据为基础,分析了当前我国城市居民绿色食品的消费意识、消费行为特征以及影响绿色食品消费行为的各种因素;指出我国城市居民已普遍接受绿色食品消费并愿意承担额外的费用,食品安全已经深入人心;并进一步建立了居民绿色食品购买行为决策模型;最后,就绿色食品的推广和普及提出了相关建议。
关键词:
绿色食品;消费行为;绿色农产品;食品安全
FactorsinfluencingonGreenFoodPurchasingBehaviorof UrbanConsumers
Abstract:
WithChina'sincreasingstandardoflivingandthechangesinsupplyanddemandofagriculturalproducts,moreandmorepeopleareconcernedaboutthehighqualityanddiversityofagriculturalproducts,whichcanbemanifestedinthatpeoplenowfocusonthequality,hygieneandsecurityoffoodratherthanthequantityofit.China'sgreenfoodbusinesscomesintobeingundersuchcircumstances.Aftertenyearsofefforts,ithasreceivedaconsiderabledevelopment.Basedonquestionnairedata,Thisthesisanalysestheconsumerawareness,thecharacteristicsofconsumerbehaviorofcurrenturbanresidentsandvariousfactorsthataffectthecharacteristicsofconsumerbehaviorofcurrenturbanresidentsandvariousfactorsthataffecttheconsumerbehaviorofgreenfood.ItpointedoutthatChina'surbanresidentshavegenerallyacceptedgreenfoodaswellasitsextrachargeandthethoughtoffoodsafetyhasdeeplyrootedinpeople’smind.Decisionmodelsofresidents’greenfoodpurchasingbehaviorisalsograduallybeingestablished.Atlast,thisarticlemakessomesuggestionsonthepopularizationofgreenfood.
Keywords:
Greenfood;Consumerbehavior;Greenagric
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- VC 简易代理服务器的设计Socket编程 简易 代理服务器 设计 Socket 编程