工具项目

HPSocket4C.cpp 146KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141
  1. /*
  2. * Copyright: JessMA Open Source (ldcsaa@gmail.com)
  3. *
  4. * Author : Bruce Liang
  5. * Website : http://www.jessma.org
  6. * Project : https://github.com/ldcsaa
  7. * Blog : http://www.cnblogs.com/ldcsaa
  8. * Wiki : http://www.oschina.net/p/hp-socket
  9. * QQ Group : 75375912, 44636872
  10. *
  11. * Licensed under the Apache License, Version 2.0 (the "License");
  12. * you may not use this file except in compliance with the License.
  13. * You may obtain a copy of the License at
  14. *
  15. * http://www.apache.org/licenses/LICENSE-2.0
  16. *
  17. * Unless required by applicable law or agreed to in writing, software
  18. * distributed under the License is distributed on an "AS IS" BASIS,
  19. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. * See the License for the specific language governing permissions and
  21. * limitations under the License.
  22. */
  23. #include "stdafx.h"
  24. #include "SocketObject4C.h"
  25. #include "TcpServer.h"
  26. #include "TcpClient.h"
  27. #include "TcpAgent.h"
  28. #include "TcpPullServer.h"
  29. #include "TcpPullClient.h"
  30. #include "TcpPullAgent.h"
  31. #include "TcpPackServer.h"
  32. #include "TcpPackClient.h"
  33. #include "TcpPackAgent.h"
  34. #include "UdpServer.h"
  35. #include "UdpClient.h"
  36. #include "UdpCast.h"
  37. #ifdef _HTTP_SUPPORT
  38. #include "HttpServer.h"
  39. #include "HttpAgent.h"
  40. #include "HttpClient.h"
  41. #endif
  42. #if !defined(_WIN64) && !defined(HPSOCKET_STATIC_LIB)
  43. #pragma comment(linker, "/EXPORT:Create_HP_TcpAgent=_Create_HP_TcpAgent@4")
  44. #pragma comment(linker, "/EXPORT:Create_HP_TcpAgentListener=_Create_HP_TcpAgentListener@0")
  45. #pragma comment(linker, "/EXPORT:Create_HP_TcpClient=_Create_HP_TcpClient@4")
  46. #pragma comment(linker, "/EXPORT:Create_HP_TcpClientListener=_Create_HP_TcpClientListener@0")
  47. #pragma comment(linker, "/EXPORT:Create_HP_TcpPackAgent=_Create_HP_TcpPackAgent@4")
  48. #pragma comment(linker, "/EXPORT:Create_HP_TcpPackAgentListener=_Create_HP_TcpPackAgentListener@0")
  49. #pragma comment(linker, "/EXPORT:Create_HP_TcpPackClient=_Create_HP_TcpPackClient@4")
  50. #pragma comment(linker, "/EXPORT:Create_HP_TcpPackClientListener=_Create_HP_TcpPackClientListener@0")
  51. #pragma comment(linker, "/EXPORT:Create_HP_TcpPackServer=_Create_HP_TcpPackServer@4")
  52. #pragma comment(linker, "/EXPORT:Create_HP_TcpPackServerListener=_Create_HP_TcpPackServerListener@0")
  53. #pragma comment(linker, "/EXPORT:Create_HP_TcpPullAgent=_Create_HP_TcpPullAgent@4")
  54. #pragma comment(linker, "/EXPORT:Create_HP_TcpPullAgentListener=_Create_HP_TcpPullAgentListener@0")
  55. #pragma comment(linker, "/EXPORT:Create_HP_TcpPullClient=_Create_HP_TcpPullClient@4")
  56. #pragma comment(linker, "/EXPORT:Create_HP_TcpPullClientListener=_Create_HP_TcpPullClientListener@0")
  57. #pragma comment(linker, "/EXPORT:Create_HP_TcpPullServer=_Create_HP_TcpPullServer@4")
  58. #pragma comment(linker, "/EXPORT:Create_HP_TcpPullServerListener=_Create_HP_TcpPullServerListener@0")
  59. #pragma comment(linker, "/EXPORT:Create_HP_TcpServer=_Create_HP_TcpServer@4")
  60. #pragma comment(linker, "/EXPORT:Create_HP_TcpServerListener=_Create_HP_TcpServerListener@0")
  61. #pragma comment(linker, "/EXPORT:Create_HP_UdpCast=_Create_HP_UdpCast@4")
  62. #pragma comment(linker, "/EXPORT:Create_HP_UdpCastListener=_Create_HP_UdpCastListener@0")
  63. #pragma comment(linker, "/EXPORT:Create_HP_UdpClient=_Create_HP_UdpClient@4")
  64. #pragma comment(linker, "/EXPORT:Create_HP_UdpClientListener=_Create_HP_UdpClientListener@0")
  65. #pragma comment(linker, "/EXPORT:Create_HP_UdpServer=_Create_HP_UdpServer@4")
  66. #pragma comment(linker, "/EXPORT:Create_HP_UdpServerListener=_Create_HP_UdpServerListener@0")
  67. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpAgent=_Destroy_HP_TcpAgent@4")
  68. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpAgentListener=_Destroy_HP_TcpAgentListener@4")
  69. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpClient=_Destroy_HP_TcpClient@4")
  70. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpClientListener=_Destroy_HP_TcpClientListener@4")
  71. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPackAgent=_Destroy_HP_TcpPackAgent@4")
  72. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPackAgentListener=_Destroy_HP_TcpPackAgentListener@4")
  73. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPackClient=_Destroy_HP_TcpPackClient@4")
  74. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPackClientListener=_Destroy_HP_TcpPackClientListener@4")
  75. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPackServer=_Destroy_HP_TcpPackServer@4")
  76. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPackServerListener=_Destroy_HP_TcpPackServerListener@4")
  77. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPullAgent=_Destroy_HP_TcpPullAgent@4")
  78. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPullAgentListener=_Destroy_HP_TcpPullAgentListener@4")
  79. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPullClient=_Destroy_HP_TcpPullClient@4")
  80. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPullClientListener=_Destroy_HP_TcpPullClientListener@4")
  81. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPullServer=_Destroy_HP_TcpPullServer@4")
  82. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpPullServerListener=_Destroy_HP_TcpPullServerListener@4")
  83. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpServer=_Destroy_HP_TcpServer@4")
  84. #pragma comment(linker, "/EXPORT:Destroy_HP_TcpServerListener=_Destroy_HP_TcpServerListener@4")
  85. #pragma comment(linker, "/EXPORT:Destroy_HP_UdpCast=_Destroy_HP_UdpCast@4")
  86. #pragma comment(linker, "/EXPORT:Destroy_HP_UdpCastListener=_Destroy_HP_UdpCastListener@4")
  87. #pragma comment(linker, "/EXPORT:Destroy_HP_UdpClient=_Destroy_HP_UdpClient@4")
  88. #pragma comment(linker, "/EXPORT:Destroy_HP_UdpClientListener=_Destroy_HP_UdpClientListener@4")
  89. #pragma comment(linker, "/EXPORT:Destroy_HP_UdpServer=_Destroy_HP_UdpServer@4")
  90. #pragma comment(linker, "/EXPORT:Destroy_HP_UdpServerListener=_Destroy_HP_UdpServerListener@4")
  91. #pragma comment(linker, "/EXPORT:HP_Agent_Connect=_HP_Agent_Connect@16")
  92. #pragma comment(linker, "/EXPORT:HP_Agent_ConnectWithExtra=_HP_Agent_ConnectWithExtra@20")
  93. #pragma comment(linker, "/EXPORT:HP_Agent_Disconnect=_HP_Agent_Disconnect@12")
  94. #pragma comment(linker, "/EXPORT:HP_Agent_DisconnectLongConnections=_HP_Agent_DisconnectLongConnections@12")
  95. #pragma comment(linker, "/EXPORT:HP_Agent_DisconnectSilenceConnections=_HP_Agent_DisconnectSilenceConnections@12")
  96. #pragma comment(linker, "/EXPORT:HP_Agent_GetAllConnectionIDs=_HP_Agent_GetAllConnectionIDs@12")
  97. #pragma comment(linker, "/EXPORT:HP_Agent_GetConnectPeriod=_HP_Agent_GetConnectPeriod@12")
  98. #pragma comment(linker, "/EXPORT:HP_Agent_GetConnectionCount=_HP_Agent_GetConnectionCount@4")
  99. #pragma comment(linker, "/EXPORT:HP_Agent_GetConnectionExtra=_HP_Agent_GetConnectionExtra@12")
  100. #pragma comment(linker, "/EXPORT:HP_Agent_GetFreeBufferObjHold=_HP_Agent_GetFreeBufferObjHold@4")
  101. #pragma comment(linker, "/EXPORT:HP_Agent_GetFreeBufferObjPool=_HP_Agent_GetFreeBufferObjPool@4")
  102. #pragma comment(linker, "/EXPORT:HP_Agent_GetFreeSocketObjHold=_HP_Agent_GetFreeSocketObjHold@4")
  103. #pragma comment(linker, "/EXPORT:HP_Agent_GetFreeSocketObjLockTime=_HP_Agent_GetFreeSocketObjLockTime@4")
  104. #pragma comment(linker, "/EXPORT:HP_Agent_GetFreeSocketObjPool=_HP_Agent_GetFreeSocketObjPool@4")
  105. #pragma comment(linker, "/EXPORT:HP_Agent_GetLastError=_HP_Agent_GetLastError@4")
  106. #pragma comment(linker, "/EXPORT:HP_Agent_GetLastErrorDesc=_HP_Agent_GetLastErrorDesc@4")
  107. #pragma comment(linker, "/EXPORT:HP_Agent_GetLocalAddress=_HP_Agent_GetLocalAddress@20")
  108. #pragma comment(linker, "/EXPORT:HP_Agent_GetMaxConnectionCount=_HP_Agent_GetMaxConnectionCount@4")
  109. #pragma comment(linker, "/EXPORT:HP_Agent_GetPendingDataLength=_HP_Agent_GetPendingDataLength@12")
  110. #pragma comment(linker, "/EXPORT:HP_Agent_GetRemoteAddress=_HP_Agent_GetRemoteAddress@20")
  111. #pragma comment(linker, "/EXPORT:HP_Agent_GetRemoteHost=_HP_Agent_GetRemoteHost@20")
  112. #pragma comment(linker, "/EXPORT:HP_Agent_GetSendPolicy=_HP_Agent_GetSendPolicy@4")
  113. #pragma comment(linker, "/EXPORT:HP_Agent_GetSilencePeriod=_HP_Agent_GetSilencePeriod@12")
  114. #pragma comment(linker, "/EXPORT:HP_Agent_GetState=_HP_Agent_GetState@4")
  115. #pragma comment(linker, "/EXPORT:HP_Agent_GetWorkerThreadCount=_HP_Agent_GetWorkerThreadCount@4")
  116. #pragma comment(linker, "/EXPORT:HP_Agent_HasStarted=_HP_Agent_HasStarted@4")
  117. #pragma comment(linker, "/EXPORT:HP_Agent_IsMarkSilence=_HP_Agent_IsMarkSilence@4")
  118. #pragma comment(linker, "/EXPORT:HP_Agent_IsPauseReceive=_HP_Agent_IsPauseReceive@12")
  119. #pragma comment(linker, "/EXPORT:HP_Agent_IsSecure=_HP_Agent_IsSecure@4")
  120. #pragma comment(linker, "/EXPORT:HP_Agent_PauseReceive=_HP_Agent_PauseReceive@12")
  121. #pragma comment(linker, "/EXPORT:HP_Agent_Send=_HP_Agent_Send@16")
  122. #pragma comment(linker, "/EXPORT:HP_Agent_SendPackets=_HP_Agent_SendPackets@16")
  123. #pragma comment(linker, "/EXPORT:HP_Agent_SendPart=_HP_Agent_SendPart@20")
  124. #pragma comment(linker, "/EXPORT:HP_Agent_SetConnectionExtra=_HP_Agent_SetConnectionExtra@12")
  125. #pragma comment(linker, "/EXPORT:HP_Agent_SetFreeBufferObjHold=_HP_Agent_SetFreeBufferObjHold@8")
  126. #pragma comment(linker, "/EXPORT:HP_Agent_SetFreeBufferObjPool=_HP_Agent_SetFreeBufferObjPool@8")
  127. #pragma comment(linker, "/EXPORT:HP_Agent_SetFreeSocketObjHold=_HP_Agent_SetFreeSocketObjHold@8")
  128. #pragma comment(linker, "/EXPORT:HP_Agent_SetFreeSocketObjLockTime=_HP_Agent_SetFreeSocketObjLockTime@8")
  129. #pragma comment(linker, "/EXPORT:HP_Agent_SetFreeSocketObjPool=_HP_Agent_SetFreeSocketObjPool@8")
  130. #pragma comment(linker, "/EXPORT:HP_Agent_SetMarkSilence=_HP_Agent_SetMarkSilence@8")
  131. #pragma comment(linker, "/EXPORT:HP_Agent_SetMaxConnectionCount=_HP_Agent_SetMaxConnectionCount@8")
  132. #pragma comment(linker, "/EXPORT:HP_Agent_SetSendPolicy=_HP_Agent_SetSendPolicy@8")
  133. #pragma comment(linker, "/EXPORT:HP_Agent_SetWorkerThreadCount=_HP_Agent_SetWorkerThreadCount@8")
  134. #pragma comment(linker, "/EXPORT:HP_Agent_Start=_HP_Agent_Start@12")
  135. #pragma comment(linker, "/EXPORT:HP_Agent_Stop=_HP_Agent_Stop@4")
  136. #pragma comment(linker, "/EXPORT:HP_Client_GetConnectionID=_HP_Client_GetConnectionID@4")
  137. #pragma comment(linker, "/EXPORT:HP_Client_GetExtra=_HP_Client_GetExtra@4")
  138. #pragma comment(linker, "/EXPORT:HP_Client_GetFreeBufferPoolHold=_HP_Client_GetFreeBufferPoolHold@4")
  139. #pragma comment(linker, "/EXPORT:HP_Client_GetFreeBufferPoolSize=_HP_Client_GetFreeBufferPoolSize@4")
  140. #pragma comment(linker, "/EXPORT:HP_Client_GetLastError=_HP_Client_GetLastError@4")
  141. #pragma comment(linker, "/EXPORT:HP_Client_GetLastErrorDesc=_HP_Client_GetLastErrorDesc@4")
  142. #pragma comment(linker, "/EXPORT:HP_Client_GetLocalAddress=_HP_Client_GetLocalAddress@16")
  143. #pragma comment(linker, "/EXPORT:HP_Client_GetPendingDataLength=_HP_Client_GetPendingDataLength@8")
  144. #pragma comment(linker, "/EXPORT:HP_Client_GetRemoteHost=_HP_Client_GetRemoteHost@16")
  145. #pragma comment(linker, "/EXPORT:HP_Client_GetState=_HP_Client_GetState@4")
  146. #pragma comment(linker, "/EXPORT:HP_Client_HasStarted=_HP_Client_HasStarted@4")
  147. #pragma comment(linker, "/EXPORT:HP_Client_IsPauseReceive=_HP_Client_IsPauseReceive@8")
  148. #pragma comment(linker, "/EXPORT:HP_Client_IsSecure=_HP_Client_IsSecure@4")
  149. #pragma comment(linker, "/EXPORT:HP_Client_PauseReceive=_HP_Client_PauseReceive@8")
  150. #pragma comment(linker, "/EXPORT:HP_Client_Send=_HP_Client_Send@12")
  151. #pragma comment(linker, "/EXPORT:HP_Client_SendPackets=_HP_Client_SendPackets@12")
  152. #pragma comment(linker, "/EXPORT:HP_Client_SendPart=_HP_Client_SendPart@16")
  153. #pragma comment(linker, "/EXPORT:HP_Client_SetExtra=_HP_Client_SetExtra@8")
  154. #pragma comment(linker, "/EXPORT:HP_Client_SetFreeBufferPoolHold=_HP_Client_SetFreeBufferPoolHold@8")
  155. #pragma comment(linker, "/EXPORT:HP_Client_SetFreeBufferPoolSize=_HP_Client_SetFreeBufferPoolSize@8")
  156. #pragma comment(linker, "/EXPORT:HP_Client_Start=_HP_Client_Start@16")
  157. #pragma comment(linker, "/EXPORT:HP_Client_StartWithBindAddress=_HP_Client_StartWithBindAddress@20")
  158. #pragma comment(linker, "/EXPORT:HP_Client_Stop=_HP_Client_Stop@4")
  159. #pragma comment(linker, "/EXPORT:HP_GetHPSocketVersion=_HP_GetHPSocketVersion@0")
  160. #pragma comment(linker, "/EXPORT:HP_GetSocketErrorDesc=_HP_GetSocketErrorDesc@4")
  161. #pragma comment(linker, "/EXPORT:HP_Server_Disconnect=_HP_Server_Disconnect@12")
  162. #pragma comment(linker, "/EXPORT:HP_Server_DisconnectLongConnections=_HP_Server_DisconnectLongConnections@12")
  163. #pragma comment(linker, "/EXPORT:HP_Server_DisconnectSilenceConnections=_HP_Server_DisconnectSilenceConnections@12")
  164. #pragma comment(linker, "/EXPORT:HP_Server_GetAllConnectionIDs=_HP_Server_GetAllConnectionIDs@12")
  165. #pragma comment(linker, "/EXPORT:HP_Server_GetConnectPeriod=_HP_Server_GetConnectPeriod@12")
  166. #pragma comment(linker, "/EXPORT:HP_Server_GetConnectionCount=_HP_Server_GetConnectionCount@4")
  167. #pragma comment(linker, "/EXPORT:HP_Server_GetConnectionExtra=_HP_Server_GetConnectionExtra@12")
  168. #pragma comment(linker, "/EXPORT:HP_Server_GetFreeBufferObjHold=_HP_Server_GetFreeBufferObjHold@4")
  169. #pragma comment(linker, "/EXPORT:HP_Server_GetFreeBufferObjPool=_HP_Server_GetFreeBufferObjPool@4")
  170. #pragma comment(linker, "/EXPORT:HP_Server_GetFreeSocketObjHold=_HP_Server_GetFreeSocketObjHold@4")
  171. #pragma comment(linker, "/EXPORT:HP_Server_GetFreeSocketObjLockTime=_HP_Server_GetFreeSocketObjLockTime@4")
  172. #pragma comment(linker, "/EXPORT:HP_Server_GetFreeSocketObjPool=_HP_Server_GetFreeSocketObjPool@4")
  173. #pragma comment(linker, "/EXPORT:HP_Server_GetLastError=_HP_Server_GetLastError@4")
  174. #pragma comment(linker, "/EXPORT:HP_Server_GetLastErrorDesc=_HP_Server_GetLastErrorDesc@4")
  175. #pragma comment(linker, "/EXPORT:HP_Server_GetListenAddress=_HP_Server_GetListenAddress@16")
  176. #pragma comment(linker, "/EXPORT:HP_Server_GetLocalAddress=_HP_Server_GetLocalAddress@20")
  177. #pragma comment(linker, "/EXPORT:HP_Server_GetMaxConnectionCount=_HP_Server_GetMaxConnectionCount@4")
  178. #pragma comment(linker, "/EXPORT:HP_Server_GetPendingDataLength=_HP_Server_GetPendingDataLength@12")
  179. #pragma comment(linker, "/EXPORT:HP_Server_GetRemoteAddress=_HP_Server_GetRemoteAddress@20")
  180. #pragma comment(linker, "/EXPORT:HP_Server_GetSendPolicy=_HP_Server_GetSendPolicy@4")
  181. #pragma comment(linker, "/EXPORT:HP_Server_GetSilencePeriod=_HP_Server_GetSilencePeriod@12")
  182. #pragma comment(linker, "/EXPORT:HP_Server_GetState=_HP_Server_GetState@4")
  183. #pragma comment(linker, "/EXPORT:HP_Server_GetWorkerThreadCount=_HP_Server_GetWorkerThreadCount@4")
  184. #pragma comment(linker, "/EXPORT:HP_Server_HasStarted=_HP_Server_HasStarted@4")
  185. #pragma comment(linker, "/EXPORT:HP_Server_IsMarkSilence=_HP_Server_IsMarkSilence@4")
  186. #pragma comment(linker, "/EXPORT:HP_Server_IsPauseReceive=_HP_Server_IsPauseReceive@12")
  187. #pragma comment(linker, "/EXPORT:HP_Server_IsSecure=_HP_Server_IsSecure@4")
  188. #pragma comment(linker, "/EXPORT:HP_Server_PauseReceive=_HP_Server_PauseReceive@12")
  189. #pragma comment(linker, "/EXPORT:HP_Server_Send=_HP_Server_Send@16")
  190. #pragma comment(linker, "/EXPORT:HP_Server_SendPackets=_HP_Server_SendPackets@16")
  191. #pragma comment(linker, "/EXPORT:HP_Server_SendPart=_HP_Server_SendPart@20")
  192. #pragma comment(linker, "/EXPORT:HP_Server_SetConnectionExtra=_HP_Server_SetConnectionExtra@12")
  193. #pragma comment(linker, "/EXPORT:HP_Server_SetFreeBufferObjHold=_HP_Server_SetFreeBufferObjHold@8")
  194. #pragma comment(linker, "/EXPORT:HP_Server_SetFreeBufferObjPool=_HP_Server_SetFreeBufferObjPool@8")
  195. #pragma comment(linker, "/EXPORT:HP_Server_SetFreeSocketObjHold=_HP_Server_SetFreeSocketObjHold@8")
  196. #pragma comment(linker, "/EXPORT:HP_Server_SetFreeSocketObjLockTime=_HP_Server_SetFreeSocketObjLockTime@8")
  197. #pragma comment(linker, "/EXPORT:HP_Server_SetFreeSocketObjPool=_HP_Server_SetFreeSocketObjPool@8")
  198. #pragma comment(linker, "/EXPORT:HP_Server_SetMarkSilence=_HP_Server_SetMarkSilence@8")
  199. #pragma comment(linker, "/EXPORT:HP_Server_SetMaxConnectionCount=_HP_Server_SetMaxConnectionCount@8")
  200. #pragma comment(linker, "/EXPORT:HP_Server_SetSendPolicy=_HP_Server_SetSendPolicy@8")
  201. #pragma comment(linker, "/EXPORT:HP_Server_SetWorkerThreadCount=_HP_Server_SetWorkerThreadCount@8")
  202. #pragma comment(linker, "/EXPORT:HP_Server_Start=_HP_Server_Start@12")
  203. #pragma comment(linker, "/EXPORT:HP_Server_Stop=_HP_Server_Stop@4")
  204. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnClose=_HP_Set_FN_Agent_OnClose@8")
  205. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnConnect=_HP_Set_FN_Agent_OnConnect@8")
  206. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnHandShake=_HP_Set_FN_Agent_OnHandShake@8")
  207. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnPrepareConnect=_HP_Set_FN_Agent_OnPrepareConnect@8")
  208. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnPullReceive=_HP_Set_FN_Agent_OnPullReceive@8")
  209. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnReceive=_HP_Set_FN_Agent_OnReceive@8")
  210. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnSend=_HP_Set_FN_Agent_OnSend@8")
  211. #pragma comment(linker, "/EXPORT:HP_Set_FN_Agent_OnShutdown=_HP_Set_FN_Agent_OnShutdown@8")
  212. #pragma comment(linker, "/EXPORT:HP_Set_FN_Client_OnClose=_HP_Set_FN_Client_OnClose@8")
  213. #pragma comment(linker, "/EXPORT:HP_Set_FN_Client_OnConnect=_HP_Set_FN_Client_OnConnect@8")
  214. #pragma comment(linker, "/EXPORT:HP_Set_FN_Client_OnHandShake=_HP_Set_FN_Client_OnHandShake@8")
  215. #pragma comment(linker, "/EXPORT:HP_Set_FN_Client_OnPrepareConnect=_HP_Set_FN_Client_OnPrepareConnect@8")
  216. #pragma comment(linker, "/EXPORT:HP_Set_FN_Client_OnPullReceive=_HP_Set_FN_Client_OnPullReceive@8")
  217. #pragma comment(linker, "/EXPORT:HP_Set_FN_Client_OnReceive=_HP_Set_FN_Client_OnReceive@8")
  218. #pragma comment(linker, "/EXPORT:HP_Set_FN_Client_OnSend=_HP_Set_FN_Client_OnSend@8")
  219. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnAccept=_HP_Set_FN_Server_OnAccept@8")
  220. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnClose=_HP_Set_FN_Server_OnClose@8")
  221. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnHandShake=_HP_Set_FN_Server_OnHandShake@8")
  222. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnPrepareListen=_HP_Set_FN_Server_OnPrepareListen@8")
  223. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnPullReceive=_HP_Set_FN_Server_OnPullReceive@8")
  224. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnReceive=_HP_Set_FN_Server_OnReceive@8")
  225. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnSend=_HP_Set_FN_Server_OnSend@8")
  226. #pragma comment(linker, "/EXPORT:HP_Set_FN_Server_OnShutdown=_HP_Set_FN_Server_OnShutdown@8")
  227. #pragma comment(linker, "/EXPORT:HP_TcpAgent_GetKeepAliveInterval=_HP_TcpAgent_GetKeepAliveInterval@4")
  228. #pragma comment(linker, "/EXPORT:HP_TcpAgent_GetKeepAliveTime=_HP_TcpAgent_GetKeepAliveTime@4")
  229. #pragma comment(linker, "/EXPORT:HP_TcpAgent_GetSocketBufferSize=_HP_TcpAgent_GetSocketBufferSize@4")
  230. #pragma comment(linker, "/EXPORT:HP_TcpAgent_IsReuseAddress=_HP_TcpAgent_IsReuseAddress@4")
  231. #pragma comment(linker, "/EXPORT:HP_TcpAgent_SendSmallFile=_HP_TcpAgent_SendSmallFile@20")
  232. #pragma comment(linker, "/EXPORT:HP_TcpAgent_SetKeepAliveInterval=_HP_TcpAgent_SetKeepAliveInterval@8")
  233. #pragma comment(linker, "/EXPORT:HP_TcpAgent_SetKeepAliveTime=_HP_TcpAgent_SetKeepAliveTime@8")
  234. #pragma comment(linker, "/EXPORT:HP_TcpAgent_SetReuseAddress=_HP_TcpAgent_SetReuseAddress@8")
  235. #pragma comment(linker, "/EXPORT:HP_TcpAgent_SetSocketBufferSize=_HP_TcpAgent_SetSocketBufferSize@8")
  236. #pragma comment(linker, "/EXPORT:HP_TcpClient_GetKeepAliveInterval=_HP_TcpClient_GetKeepAliveInterval@4")
  237. #pragma comment(linker, "/EXPORT:HP_TcpClient_GetKeepAliveTime=_HP_TcpClient_GetKeepAliveTime@4")
  238. #pragma comment(linker, "/EXPORT:HP_TcpClient_GetSocketBufferSize=_HP_TcpClient_GetSocketBufferSize@4")
  239. #pragma comment(linker, "/EXPORT:HP_TcpClient_SendSmallFile=_HP_TcpClient_SendSmallFile@16")
  240. #pragma comment(linker, "/EXPORT:HP_TcpClient_SetKeepAliveInterval=_HP_TcpClient_SetKeepAliveInterval@8")
  241. #pragma comment(linker, "/EXPORT:HP_TcpClient_SetKeepAliveTime=_HP_TcpClient_SetKeepAliveTime@8")
  242. #pragma comment(linker, "/EXPORT:HP_TcpClient_SetSocketBufferSize=_HP_TcpClient_SetSocketBufferSize@8")
  243. #pragma comment(linker, "/EXPORT:HP_TcpPackAgent_GetMaxPackSize=_HP_TcpPackAgent_GetMaxPackSize@4")
  244. #pragma comment(linker, "/EXPORT:HP_TcpPackAgent_GetPackHeaderFlag=_HP_TcpPackAgent_GetPackHeaderFlag@4")
  245. #pragma comment(linker, "/EXPORT:HP_TcpPackAgent_SetMaxPackSize=_HP_TcpPackAgent_SetMaxPackSize@8")
  246. #pragma comment(linker, "/EXPORT:HP_TcpPackAgent_SetPackHeaderFlag=_HP_TcpPackAgent_SetPackHeaderFlag@8")
  247. #pragma comment(linker, "/EXPORT:HP_TcpPackClient_GetMaxPackSize=_HP_TcpPackClient_GetMaxPackSize@4")
  248. #pragma comment(linker, "/EXPORT:HP_TcpPackClient_GetPackHeaderFlag=_HP_TcpPackClient_GetPackHeaderFlag@4")
  249. #pragma comment(linker, "/EXPORT:HP_TcpPackClient_SetMaxPackSize=_HP_TcpPackClient_SetMaxPackSize@8")
  250. #pragma comment(linker, "/EXPORT:HP_TcpPackClient_SetPackHeaderFlag=_HP_TcpPackClient_SetPackHeaderFlag@8")
  251. #pragma comment(linker, "/EXPORT:HP_TcpPackServer_GetMaxPackSize=_HP_TcpPackServer_GetMaxPackSize@4")
  252. #pragma comment(linker, "/EXPORT:HP_TcpPackServer_GetPackHeaderFlag=_HP_TcpPackServer_GetPackHeaderFlag@4")
  253. #pragma comment(linker, "/EXPORT:HP_TcpPackServer_SetMaxPackSize=_HP_TcpPackServer_SetMaxPackSize@8")
  254. #pragma comment(linker, "/EXPORT:HP_TcpPackServer_SetPackHeaderFlag=_HP_TcpPackServer_SetPackHeaderFlag@8")
  255. #pragma comment(linker, "/EXPORT:HP_TcpPullAgent_Fetch=_HP_TcpPullAgent_Fetch@16")
  256. #pragma comment(linker, "/EXPORT:HP_TcpPullAgent_Peek=_HP_TcpPullAgent_Peek@16")
  257. #pragma comment(linker, "/EXPORT:HP_TcpPullClient_Fetch=_HP_TcpPullClient_Fetch@12")
  258. #pragma comment(linker, "/EXPORT:HP_TcpPullClient_Peek=_HP_TcpPullClient_Peek@12")
  259. #pragma comment(linker, "/EXPORT:HP_TcpPullServer_Fetch=_HP_TcpPullServer_Fetch@16")
  260. #pragma comment(linker, "/EXPORT:HP_TcpPullServer_Peek=_HP_TcpPullServer_Peek@16")
  261. #pragma comment(linker, "/EXPORT:HP_TcpServer_GetAcceptSocketCount=_HP_TcpServer_GetAcceptSocketCount@4")
  262. #pragma comment(linker, "/EXPORT:HP_TcpServer_GetKeepAliveInterval=_HP_TcpServer_GetKeepAliveInterval@4")
  263. #pragma comment(linker, "/EXPORT:HP_TcpServer_GetKeepAliveTime=_HP_TcpServer_GetKeepAliveTime@4")
  264. #pragma comment(linker, "/EXPORT:HP_TcpServer_GetSocketBufferSize=_HP_TcpServer_GetSocketBufferSize@4")
  265. #pragma comment(linker, "/EXPORT:HP_TcpServer_GetSocketListenQueue=_HP_TcpServer_GetSocketListenQueue@4")
  266. #pragma comment(linker, "/EXPORT:HP_TcpServer_SendSmallFile=_HP_TcpServer_SendSmallFile@20")
  267. #pragma comment(linker, "/EXPORT:HP_TcpServer_SetAcceptSocketCount=_HP_TcpServer_SetAcceptSocketCount@8")
  268. #pragma comment(linker, "/EXPORT:HP_TcpServer_SetKeepAliveInterval=_HP_TcpServer_SetKeepAliveInterval@8")
  269. #pragma comment(linker, "/EXPORT:HP_TcpServer_SetKeepAliveTime=_HP_TcpServer_SetKeepAliveTime@8")
  270. #pragma comment(linker, "/EXPORT:HP_TcpServer_SetSocketBufferSize=_HP_TcpServer_SetSocketBufferSize@8")
  271. #pragma comment(linker, "/EXPORT:HP_TcpServer_SetSocketListenQueue=_HP_TcpServer_SetSocketListenQueue@8")
  272. #pragma comment(linker, "/EXPORT:HP_UdpCast_GetCastMode=_HP_UdpCast_GetCastMode@4")
  273. #pragma comment(linker, "/EXPORT:HP_UdpCast_GetMaxDatagramSize=_HP_UdpCast_GetMaxDatagramSize@4")
  274. #pragma comment(linker, "/EXPORT:HP_UdpCast_GetMultiCastTtl=_HP_UdpCast_GetMultiCastTtl@4")
  275. #pragma comment(linker, "/EXPORT:HP_UdpCast_GetRemoteAddress=_HP_UdpCast_GetRemoteAddress@16")
  276. #pragma comment(linker, "/EXPORT:HP_UdpCast_IsMultiCastLoop=_HP_UdpCast_IsMultiCastLoop@4")
  277. #pragma comment(linker, "/EXPORT:HP_UdpCast_IsReuseAddress=_HP_UdpCast_IsReuseAddress@4")
  278. #pragma comment(linker, "/EXPORT:HP_UdpCast_SetCastMode=_HP_UdpCast_SetCastMode@8")
  279. #pragma comment(linker, "/EXPORT:HP_UdpCast_SetMaxDatagramSize=_HP_UdpCast_SetMaxDatagramSize@8")
  280. #pragma comment(linker, "/EXPORT:HP_UdpCast_SetMultiCastLoop=_HP_UdpCast_SetMultiCastLoop@8")
  281. #pragma comment(linker, "/EXPORT:HP_UdpCast_SetMultiCastTtl=_HP_UdpCast_SetMultiCastTtl@8")
  282. #pragma comment(linker, "/EXPORT:HP_UdpCast_SetReuseAddress=_HP_UdpCast_SetReuseAddress@8")
  283. #pragma comment(linker, "/EXPORT:HP_UdpClient_GetDetectAttempts=_HP_UdpClient_GetDetectAttempts@4")
  284. #pragma comment(linker, "/EXPORT:HP_UdpClient_GetDetectInterval=_HP_UdpClient_GetDetectInterval@4")
  285. #pragma comment(linker, "/EXPORT:HP_UdpClient_GetMaxDatagramSize=_HP_UdpClient_GetMaxDatagramSize@4")
  286. #pragma comment(linker, "/EXPORT:HP_UdpClient_SetDetectAttempts=_HP_UdpClient_SetDetectAttempts@8")
  287. #pragma comment(linker, "/EXPORT:HP_UdpClient_SetDetectInterval=_HP_UdpClient_SetDetectInterval@8")
  288. #pragma comment(linker, "/EXPORT:HP_UdpClient_SetMaxDatagramSize=_HP_UdpClient_SetMaxDatagramSize@8")
  289. #pragma comment(linker, "/EXPORT:HP_UdpServer_GetDetectAttempts=_HP_UdpServer_GetDetectAttempts@4")
  290. #pragma comment(linker, "/EXPORT:HP_UdpServer_GetDetectInterval=_HP_UdpServer_GetDetectInterval@4")
  291. #pragma comment(linker, "/EXPORT:HP_UdpServer_GetMaxDatagramSize=_HP_UdpServer_GetMaxDatagramSize@4")
  292. #pragma comment(linker, "/EXPORT:HP_UdpServer_GetPostReceiveCount=_HP_UdpServer_GetPostReceiveCount@4")
  293. #pragma comment(linker, "/EXPORT:HP_UdpServer_SetDetectAttempts=_HP_UdpServer_SetDetectAttempts@8")
  294. #pragma comment(linker, "/EXPORT:HP_UdpServer_SetDetectInterval=_HP_UdpServer_SetDetectInterval@8")
  295. #pragma comment(linker, "/EXPORT:HP_UdpServer_SetMaxDatagramSize=_HP_UdpServer_SetMaxDatagramSize@8")
  296. #pragma comment(linker, "/EXPORT:HP_UdpServer_SetPostReceiveCount=_HP_UdpServer_SetPostReceiveCount@8")
  297. #pragma comment(linker, "/EXPORT:SYS_Base64Decode=_SYS_Base64Decode@16")
  298. #pragma comment(linker, "/EXPORT:SYS_Base64Encode=_SYS_Base64Encode@16")
  299. #pragma comment(linker, "/EXPORT:SYS_CodePageToUnicode=_SYS_CodePageToUnicode@16")
  300. #pragma comment(linker, "/EXPORT:SYS_Compress=_SYS_Compress@16")
  301. #pragma comment(linker, "/EXPORT:SYS_CompressEx=_SYS_CompressEx@36")
  302. #pragma comment(linker, "/EXPORT:SYS_EnumHostIPAddresses=_SYS_EnumHostIPAddresses@16")
  303. #pragma comment(linker, "/EXPORT:SYS_FreeHostIPAddresses=_SYS_FreeHostIPAddresses@4")
  304. #pragma comment(linker, "/EXPORT:SYS_GZipCompress=_SYS_GZipCompress@16")
  305. #pragma comment(linker, "/EXPORT:SYS_GZipGuessUncompressBound=_SYS_GZipGuessUncompressBound@8")
  306. #pragma comment(linker, "/EXPORT:SYS_GZipUncompress=_SYS_GZipUncompress@16")
  307. #pragma comment(linker, "/EXPORT:SYS_GbkToUnicode=_SYS_GbkToUnicode@12")
  308. #pragma comment(linker, "/EXPORT:SYS_GbkToUtf8=_SYS_GbkToUtf8@12")
  309. #pragma comment(linker, "/EXPORT:SYS_GetIPAddress=_SYS_GetIPAddress@16")
  310. #pragma comment(linker, "/EXPORT:SYS_GetLastError=_SYS_GetLastError@0")
  311. #pragma comment(linker, "/EXPORT:SYS_GetSocketLocalAddress=_SYS_GetSocketLocalAddress@16")
  312. #pragma comment(linker, "/EXPORT:SYS_GetSocketOption=_SYS_GetSocketOption@20")
  313. #pragma comment(linker, "/EXPORT:SYS_GetSocketRemoteAddress=_SYS_GetSocketRemoteAddress@16")
  314. #pragma comment(linker, "/EXPORT:SYS_GuessBase64DecodeBound=_SYS_GuessBase64DecodeBound@8")
  315. #pragma comment(linker, "/EXPORT:SYS_GuessBase64EncodeBound=_SYS_GuessBase64EncodeBound@4")
  316. #pragma comment(linker, "/EXPORT:SYS_GuessCompressBound=_SYS_GuessCompressBound@8")
  317. #pragma comment(linker, "/EXPORT:SYS_GuessUrlDecodeBound=_SYS_GuessUrlDecodeBound@8")
  318. #pragma comment(linker, "/EXPORT:SYS_GuessUrlEncodeBound=_SYS_GuessUrlEncodeBound@8")
  319. #pragma comment(linker, "/EXPORT:SYS_HToN64=_SYS_HToN64@8")
  320. #pragma comment(linker, "/EXPORT:SYS_IoctlSocket=_SYS_IoctlSocket@12")
  321. #pragma comment(linker, "/EXPORT:SYS_IsIPAddress=_SYS_IsIPAddress@8")
  322. #pragma comment(linker, "/EXPORT:SYS_NToH64=_SYS_NToH64@8")
  323. #pragma comment(linker, "/EXPORT:SYS_SSO_DontLinger=_SYS_SSO_DontLinger@8")
  324. #pragma comment(linker, "/EXPORT:SYS_SSO_Linger=_SYS_SSO_Linger@12")
  325. #pragma comment(linker, "/EXPORT:SYS_SSO_NoDelay=_SYS_SSO_NoDelay@8")
  326. #pragma comment(linker, "/EXPORT:SYS_SSO_RecvBuffSize=_SYS_SSO_RecvBuffSize@8")
  327. #pragma comment(linker, "/EXPORT:SYS_SSO_ReuseAddress=_SYS_SSO_ReuseAddress@8")
  328. #pragma comment(linker, "/EXPORT:SYS_SSO_SendBuffSize=_SYS_SSO_SendBuffSize@8")
  329. #pragma comment(linker, "/EXPORT:SYS_SetSocketOption=_SYS_SetSocketOption@20")
  330. #pragma comment(linker, "/EXPORT:SYS_Uncompress=_SYS_Uncompress@16")
  331. #pragma comment(linker, "/EXPORT:SYS_UncompressEx=_SYS_UncompressEx@20")
  332. #pragma comment(linker, "/EXPORT:SYS_UnicodeToCodePage=_SYS_UnicodeToCodePage@16")
  333. #pragma comment(linker, "/EXPORT:SYS_UnicodeToGbk=_SYS_UnicodeToGbk@12")
  334. #pragma comment(linker, "/EXPORT:SYS_UnicodeToUtf8=_SYS_UnicodeToUtf8@12")
  335. #pragma comment(linker, "/EXPORT:SYS_UrlDecode=_SYS_UrlDecode@16")
  336. #pragma comment(linker, "/EXPORT:SYS_UrlEncode=_SYS_UrlEncode@16")
  337. #pragma comment(linker, "/EXPORT:SYS_Utf8ToGbk=_SYS_Utf8ToGbk@12")
  338. #pragma comment(linker, "/EXPORT:SYS_Utf8ToUnicode=_SYS_Utf8ToUnicode@12")
  339. #pragma comment(linker, "/EXPORT:SYS_WSAGetLastError=_SYS_WSAGetLastError@0")
  340. #pragma comment(linker, "/EXPORT:SYS_WSAIoctl=_SYS_WSAIoctl@28")
  341. #ifdef _HTTP_SUPPORT
  342. #pragma comment(linker, "/EXPORT:Create_HP_HttpAgent=_Create_HP_HttpAgent@4")
  343. #pragma comment(linker, "/EXPORT:Create_HP_HttpAgentListener=_Create_HP_HttpAgentListener@0")
  344. #pragma comment(linker, "/EXPORT:Create_HP_HttpClient=_Create_HP_HttpClient@4")
  345. #pragma comment(linker, "/EXPORT:Create_HP_HttpClientListener=_Create_HP_HttpClientListener@0")
  346. #pragma comment(linker, "/EXPORT:Create_HP_HttpServer=_Create_HP_HttpServer@4")
  347. #pragma comment(linker, "/EXPORT:Create_HP_HttpServerListener=_Create_HP_HttpServerListener@0")
  348. #pragma comment(linker, "/EXPORT:Create_HP_HttpSyncClient=_Create_HP_HttpSyncClient@4")
  349. #pragma comment(linker, "/EXPORT:Destroy_HP_HttpAgent=_Destroy_HP_HttpAgent@4")
  350. #pragma comment(linker, "/EXPORT:Destroy_HP_HttpAgentListener=_Destroy_HP_HttpAgentListener@4")
  351. #pragma comment(linker, "/EXPORT:Destroy_HP_HttpClient=_Destroy_HP_HttpClient@4")
  352. #pragma comment(linker, "/EXPORT:Destroy_HP_HttpClientListener=_Destroy_HP_HttpClientListener@4")
  353. #pragma comment(linker, "/EXPORT:Destroy_HP_HttpServer=_Destroy_HP_HttpServer@4")
  354. #pragma comment(linker, "/EXPORT:Destroy_HP_HttpServerListener=_Destroy_HP_HttpServerListener@4")
  355. #pragma comment(linker, "/EXPORT:Destroy_HP_HttpSyncClient=_Destroy_HP_HttpSyncClient@4")
  356. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetAllCookies=_HP_HttpAgent_GetAllCookies@16")
  357. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetAllHeaderNames=_HP_HttpAgent_GetAllHeaderNames@16")
  358. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetAllHeaders=_HP_HttpAgent_GetAllHeaders@16")
  359. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetContentEncoding=_HP_HttpAgent_GetContentEncoding@8")
  360. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetContentLength=_HP_HttpAgent_GetContentLength@8")
  361. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetContentType=_HP_HttpAgent_GetContentType@8")
  362. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetCookie=_HP_HttpAgent_GetCookie@16")
  363. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetHeader=_HP_HttpAgent_GetHeader@16")
  364. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetHeaders=_HP_HttpAgent_GetHeaders@20")
  365. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetLocalVersion=_HP_HttpAgent_GetLocalVersion@4")
  366. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetParseErrorCode=_HP_HttpAgent_GetParseErrorCode@12")
  367. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetStatusCode=_HP_HttpAgent_GetStatusCode@8")
  368. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetTransferEncoding=_HP_HttpAgent_GetTransferEncoding@8")
  369. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetUpgradeType=_HP_HttpAgent_GetUpgradeType@8")
  370. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetVersion=_HP_HttpAgent_GetVersion@8")
  371. #pragma comment(linker, "/EXPORT:HP_HttpAgent_GetWSMessageState=_HP_HttpAgent_GetWSMessageState@32")
  372. #pragma comment(linker, "/EXPORT:HP_HttpAgent_IsKeepAlive=_HP_HttpAgent_IsKeepAlive@8")
  373. #pragma comment(linker, "/EXPORT:HP_HttpAgent_IsUpgrade=_HP_HttpAgent_IsUpgrade@8")
  374. #pragma comment(linker, "/EXPORT:HP_HttpAgent_IsUseCookie=_HP_HttpAgent_IsUseCookie@4")
  375. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendConnect=_HP_HttpAgent_SendConnect@20")
  376. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendDelete=_HP_HttpAgent_SendDelete@20")
  377. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendGet=_HP_HttpAgent_SendGet@20")
  378. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendHead=_HP_HttpAgent_SendHead@20")
  379. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendLocalFile=_HP_HttpAgent_SendLocalFile@28")
  380. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendOptions=_HP_HttpAgent_SendOptions@20")
  381. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendPatch=_HP_HttpAgent_SendPatch@28")
  382. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendPost=_HP_HttpAgent_SendPost@28")
  383. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendPut=_HP_HttpAgent_SendPut@28")
  384. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendRequest=_HP_HttpAgent_SendRequest@32")
  385. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendTrace=_HP_HttpAgent_SendTrace@20")
  386. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SendWSMessage=_HP_HttpAgent_SendWSMessage@40")
  387. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SetLocalVersion=_HP_HttpAgent_SetLocalVersion@8")
  388. #pragma comment(linker, "/EXPORT:HP_HttpAgent_SetUseCookie=_HP_HttpAgent_SetUseCookie@8")
  389. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetAllCookies=_HP_HttpClient_GetAllCookies@12")
  390. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetAllHeaderNames=_HP_HttpClient_GetAllHeaderNames@12")
  391. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetAllHeaders=_HP_HttpClient_GetAllHeaders@12")
  392. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetContentEncoding=_HP_HttpClient_GetContentEncoding@4")
  393. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetContentLength=_HP_HttpClient_GetContentLength@4")
  394. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetContentType=_HP_HttpClient_GetContentType@4")
  395. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetCookie=_HP_HttpClient_GetCookie@12")
  396. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetHeader=_HP_HttpClient_GetHeader@12")
  397. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetHeaders=_HP_HttpClient_GetHeaders@16")
  398. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetLocalVersion=_HP_HttpClient_GetLocalVersion@4")
  399. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetParseErrorCode=_HP_HttpClient_GetParseErrorCode@8")
  400. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetStatusCode=_HP_HttpClient_GetStatusCode@4")
  401. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetTransferEncoding=_HP_HttpClient_GetTransferEncoding@4")
  402. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetUpgradeType=_HP_HttpClient_GetUpgradeType@4")
  403. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetVersion=_HP_HttpClient_GetVersion@4")
  404. #pragma comment(linker, "/EXPORT:HP_HttpClient_GetWSMessageState=_HP_HttpClient_GetWSMessageState@28")
  405. #pragma comment(linker, "/EXPORT:HP_HttpClient_IsKeepAlive=_HP_HttpClient_IsKeepAlive@4")
  406. #pragma comment(linker, "/EXPORT:HP_HttpClient_IsUpgrade=_HP_HttpClient_IsUpgrade@4")
  407. #pragma comment(linker, "/EXPORT:HP_HttpClient_IsUseCookie=_HP_HttpClient_IsUseCookie@4")
  408. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendConnect=_HP_HttpClient_SendConnect@16")
  409. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendDelete=_HP_HttpClient_SendDelete@16")
  410. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendGet=_HP_HttpClient_SendGet@16")
  411. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendHead=_HP_HttpClient_SendHead@16")
  412. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendLocalFile=_HP_HttpClient_SendLocalFile@24")
  413. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendOptions=_HP_HttpClient_SendOptions@16")
  414. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendPatch=_HP_HttpClient_SendPatch@24")
  415. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendPost=_HP_HttpClient_SendPost@24")
  416. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendPut=_HP_HttpClient_SendPut@24")
  417. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendRequest=_HP_HttpClient_SendRequest@28")
  418. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendTrace=_HP_HttpClient_SendTrace@16")
  419. #pragma comment(linker, "/EXPORT:HP_HttpClient_SendWSMessage=_HP_HttpClient_SendWSMessage@36")
  420. #pragma comment(linker, "/EXPORT:HP_HttpClient_SetLocalVersion=_HP_HttpClient_SetLocalVersion@8")
  421. #pragma comment(linker, "/EXPORT:HP_HttpClient_SetUseCookie=_HP_HttpClient_SetUseCookie@8")
  422. #pragma comment(linker, "/EXPORT:HP_HttpCookie_HLP_CurrentUTCTime=_HP_HttpCookie_HLP_CurrentUTCTime@0")
  423. #pragma comment(linker, "/EXPORT:HP_HttpCookie_HLP_ExpiresToMaxAge=_HP_HttpCookie_HLP_ExpiresToMaxAge@8")
  424. #pragma comment(linker, "/EXPORT:HP_HttpCookie_HLP_MakeExpiresStr=_HP_HttpCookie_HLP_MakeExpiresStr@16")
  425. #pragma comment(linker, "/EXPORT:HP_HttpCookie_HLP_MaxAgeToExpires=_HP_HttpCookie_HLP_MaxAgeToExpires@4")
  426. #pragma comment(linker, "/EXPORT:HP_HttpCookie_HLP_ParseExpires=_HP_HttpCookie_HLP_ParseExpires@8")
  427. #pragma comment(linker, "/EXPORT:HP_HttpCookie_HLP_ToString=_HP_HttpCookie_HLP_ToString@40")
  428. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_ClearCookies=_HP_HttpCookie_MGR_ClearCookies@8")
  429. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_DeleteCookie=_HP_HttpCookie_MGR_DeleteCookie@12")
  430. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_IsEnableThirdPartyCookie=_HP_HttpCookie_MGR_IsEnableThirdPartyCookie@0")
  431. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_LoadFromFile=_HP_HttpCookie_MGR_LoadFromFile@8")
  432. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_RemoveExpiredCookies=_HP_HttpCookie_MGR_RemoveExpiredCookies@8")
  433. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_SaveToFile=_HP_HttpCookie_MGR_SaveToFile@8")
  434. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_SetCookie=_HP_HttpCookie_MGR_SetCookie@36")
  435. #pragma comment(linker, "/EXPORT:HP_HttpCookie_MGR_SetEnableThirdPartyCookie=_HP_HttpCookie_MGR_SetEnableThirdPartyCookie@4")
  436. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetAllCookies=_HP_HttpServer_GetAllCookies@16")
  437. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetAllHeaderNames=_HP_HttpServer_GetAllHeaderNames@16")
  438. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetAllHeaders=_HP_HttpServer_GetAllHeaders@16")
  439. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetContentEncoding=_HP_HttpServer_GetContentEncoding@8")
  440. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetContentLength=_HP_HttpServer_GetContentLength@8")
  441. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetContentType=_HP_HttpServer_GetContentType@8")
  442. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetCookie=_HP_HttpServer_GetCookie@16")
  443. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetHeader=_HP_HttpServer_GetHeader@16")
  444. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetHeaders=_HP_HttpServer_GetHeaders@20")
  445. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetHost=_HP_HttpServer_GetHost@8")
  446. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetLocalVersion=_HP_HttpServer_GetLocalVersion@4")
  447. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetMethod=_HP_HttpServer_GetMethod@8")
  448. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetParseErrorCode=_HP_HttpServer_GetParseErrorCode@12")
  449. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetReleaseDelay=_HP_HttpServer_GetReleaseDelay@4")
  450. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetTransferEncoding=_HP_HttpServer_GetTransferEncoding@8")
  451. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetUpgradeType=_HP_HttpServer_GetUpgradeType@8")
  452. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetUrlField=_HP_HttpServer_GetUrlField@12")
  453. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetUrlFieldSet=_HP_HttpServer_GetUrlFieldSet@8")
  454. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetVersion=_HP_HttpServer_GetVersion@8")
  455. #pragma comment(linker, "/EXPORT:HP_HttpServer_GetWSMessageState=_HP_HttpServer_GetWSMessageState@32")
  456. #pragma comment(linker, "/EXPORT:HP_HttpServer_IsKeepAlive=_HP_HttpServer_IsKeepAlive@8")
  457. #pragma comment(linker, "/EXPORT:HP_HttpServer_IsUpgrade=_HP_HttpServer_IsUpgrade@8")
  458. #pragma comment(linker, "/EXPORT:HP_HttpServer_Release=_HP_HttpServer_Release@8")
  459. #pragma comment(linker, "/EXPORT:HP_HttpServer_SendLocalFile=_HP_HttpServer_SendLocalFile@28")
  460. #pragma comment(linker, "/EXPORT:HP_HttpServer_SendResponse=_HP_HttpServer_SendResponse@32")
  461. #pragma comment(linker, "/EXPORT:HP_HttpServer_SendWSMessage=_HP_HttpServer_SendWSMessage@40")
  462. #pragma comment(linker, "/EXPORT:HP_HttpServer_SetLocalVersion=_HP_HttpServer_SetLocalVersion@8")
  463. #pragma comment(linker, "/EXPORT:HP_HttpServer_SetReleaseDelay=_HP_HttpServer_SetReleaseDelay@8")
  464. #pragma comment(linker, "/EXPORT:HP_HttpSyncClient_CleanupRequestResult=_HP_HttpSyncClient_CleanupRequestResult@4")
  465. #pragma comment(linker, "/EXPORT:HP_HttpSyncClient_GetConnectTimeout=_HP_HttpSyncClient_GetConnectTimeout@4")
  466. #pragma comment(linker, "/EXPORT:HP_HttpSyncClient_GetRequestTimeout=_HP_HttpSyncClient_GetRequestTimeout@4")
  467. #pragma comment(linker, "/EXPORT:HP_HttpSyncClient_GetResponseBody=_HP_HttpSyncClient_GetResponseBody@12")
  468. #pragma comment(linker, "/EXPORT:HP_HttpSyncClient_OpenUrl=_HP_HttpSyncClient_OpenUrl@32")
  469. #pragma comment(linker, "/EXPORT:HP_HttpSyncClient_SetConnectTimeout=_HP_HttpSyncClient_SetConnectTimeout@8")
  470. #pragma comment(linker, "/EXPORT:HP_HttpSyncClient_SetRequestTimeout=_HP_HttpSyncClient_SetRequestTimeout@8")
  471. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnBody=_HP_Set_FN_HttpAgent_OnBody@8")
  472. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnChunkComplete=_HP_Set_FN_HttpAgent_OnChunkComplete@8")
  473. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnChunkHeader=_HP_Set_FN_HttpAgent_OnChunkHeader@8")
  474. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnClose=_HP_Set_FN_HttpAgent_OnClose@8")
  475. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnConnect=_HP_Set_FN_HttpAgent_OnConnect@8")
  476. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnHandShake=_HP_Set_FN_HttpAgent_OnHandShake@8")
  477. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnHeader=_HP_Set_FN_HttpAgent_OnHeader@8")
  478. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnHeadersComplete=_HP_Set_FN_HttpAgent_OnHeadersComplete@8")
  479. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnMessageBegin=_HP_Set_FN_HttpAgent_OnMessageBegin@8")
  480. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnMessageComplete=_HP_Set_FN_HttpAgent_OnMessageComplete@8")
  481. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnParseError=_HP_Set_FN_HttpAgent_OnParseError@8")
  482. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnPrepareConnect=_HP_Set_FN_HttpAgent_OnPrepareConnect@8")
  483. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnReceive=_HP_Set_FN_HttpAgent_OnReceive@8")
  484. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnSend=_HP_Set_FN_HttpAgent_OnSend@8")
  485. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnShutdown=_HP_Set_FN_HttpAgent_OnShutdown@8")
  486. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnStatusLine=_HP_Set_FN_HttpAgent_OnStatusLine@8")
  487. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnUpgrade=_HP_Set_FN_HttpAgent_OnUpgrade@8")
  488. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnWSMessageBody=_HP_Set_FN_HttpAgent_OnWSMessageBody@8")
  489. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnWSMessageComplete=_HP_Set_FN_HttpAgent_OnWSMessageComplete@8")
  490. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpAgent_OnWSMessageHeader=_HP_Set_FN_HttpAgent_OnWSMessageHeader@8")
  491. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnBody=_HP_Set_FN_HttpClient_OnBody@8")
  492. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnChunkComplete=_HP_Set_FN_HttpClient_OnChunkComplete@8")
  493. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnChunkHeader=_HP_Set_FN_HttpClient_OnChunkHeader@8")
  494. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnClose=_HP_Set_FN_HttpClient_OnClose@8")
  495. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnConnect=_HP_Set_FN_HttpClient_OnConnect@8")
  496. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnHandShake=_HP_Set_FN_HttpClient_OnHandShake@8")
  497. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnHeader=_HP_Set_FN_HttpClient_OnHeader@8")
  498. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnHeadersComplete=_HP_Set_FN_HttpClient_OnHeadersComplete@8")
  499. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnMessageBegin=_HP_Set_FN_HttpClient_OnMessageBegin@8")
  500. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnMessageComplete=_HP_Set_FN_HttpClient_OnMessageComplete@8")
  501. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnParseError=_HP_Set_FN_HttpClient_OnParseError@8")
  502. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnPrepareConnect=_HP_Set_FN_HttpClient_OnPrepareConnect@8")
  503. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnReceive=_HP_Set_FN_HttpClient_OnReceive@8")
  504. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnSend=_HP_Set_FN_HttpClient_OnSend@8")
  505. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnStatusLine=_HP_Set_FN_HttpClient_OnStatusLine@8")
  506. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnUpgrade=_HP_Set_FN_HttpClient_OnUpgrade@8")
  507. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnWSMessageBody=_HP_Set_FN_HttpClient_OnWSMessageBody@8")
  508. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnWSMessageComplete=_HP_Set_FN_HttpClient_OnWSMessageComplete@8")
  509. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpClient_OnWSMessageHeader=_HP_Set_FN_HttpClient_OnWSMessageHeader@8")
  510. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnAccept=_HP_Set_FN_HttpServer_OnAccept@8")
  511. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnBody=_HP_Set_FN_HttpServer_OnBody@8")
  512. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnChunkComplete=_HP_Set_FN_HttpServer_OnChunkComplete@8")
  513. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnChunkHeader=_HP_Set_FN_HttpServer_OnChunkHeader@8")
  514. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnClose=_HP_Set_FN_HttpServer_OnClose@8")
  515. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnHandShake=_HP_Set_FN_HttpServer_OnHandShake@8")
  516. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnHeader=_HP_Set_FN_HttpServer_OnHeader@8")
  517. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnHeadersComplete=_HP_Set_FN_HttpServer_OnHeadersComplete@8")
  518. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnMessageBegin=_HP_Set_FN_HttpServer_OnMessageBegin@8")
  519. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnMessageComplete=_HP_Set_FN_HttpServer_OnMessageComplete@8")
  520. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnParseError=_HP_Set_FN_HttpServer_OnParseError@8")
  521. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnPrepareListen=_HP_Set_FN_HttpServer_OnPrepareListen@8")
  522. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnReceive=_HP_Set_FN_HttpServer_OnReceive@8")
  523. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnRequestLine=_HP_Set_FN_HttpServer_OnRequestLine@8")
  524. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnSend=_HP_Set_FN_HttpServer_OnSend@8")
  525. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnShutdown=_HP_Set_FN_HttpServer_OnShutdown@8")
  526. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnUpgrade=_HP_Set_FN_HttpServer_OnUpgrade@8")
  527. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnWSMessageBody=_HP_Set_FN_HttpServer_OnWSMessageBody@8")
  528. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnWSMessageComplete=_HP_Set_FN_HttpServer_OnWSMessageComplete@8")
  529. #pragma comment(linker, "/EXPORT:HP_Set_FN_HttpServer_OnWSMessageHeader=_HP_Set_FN_HttpServer_OnWSMessageHeader@8")
  530. #endif
  531. #endif
  532. /*****************************************************************************************************************************************************/
  533. /****************************************************************** TCP/UDP Exports ******************************************************************/
  534. /*****************************************************************************************************************************************************/
  535. typedef C_HP_ObjectT<CTcpServer, ITcpServerListener> C_HP_TcpServer;
  536. typedef C_HP_ObjectT<CTcpPullServer, ITcpServerListener, sizeof(IPullSocket)> C_HP_TcpPullServer;
  537. typedef C_HP_ObjectT<CTcpPackServer, ITcpServerListener, sizeof(IPackSocket)> C_HP_TcpPackServer;
  538. typedef C_HP_ObjectT<CTcpAgent, ITcpAgentListener> C_HP_TcpAgent;
  539. typedef C_HP_ObjectT<CTcpPullAgent, ITcpAgentListener, sizeof(IPullSocket)> C_HP_TcpPullAgent;
  540. typedef C_HP_ObjectT<CTcpPackAgent, ITcpAgentListener, sizeof(IPackSocket)> C_HP_TcpPackAgent;
  541. typedef C_HP_ObjectT<CTcpClient, ITcpClientListener> C_HP_TcpClient;
  542. typedef C_HP_ObjectT<CTcpPullClient, ITcpClientListener, sizeof(IPullClient)> C_HP_TcpPullClient;
  543. typedef C_HP_ObjectT<CTcpPackClient, ITcpClientListener, sizeof(IPackClient)> C_HP_TcpPackClient;
  544. typedef C_HP_ObjectT<CUdpServer, IUdpServerListener> C_HP_UdpServer;
  545. typedef C_HP_ObjectT<CUdpClient, IUdpClientListener> C_HP_UdpClient;
  546. typedef C_HP_ObjectT<CUdpCast, IUdpCastListener> C_HP_UdpCast;
  547. /****************************************************/
  548. /**************** TCP/UDP 对象创建函数 ***************/
  549. HPSOCKET_API HP_TcpServer __HP_CALL Create_HP_TcpServer(HP_TcpServerListener pListener)
  550. {
  551. return (HP_TcpServer)(new C_HP_TcpServer((ITcpServerListener*)pListener));
  552. }
  553. HPSOCKET_API HP_TcpAgent __HP_CALL Create_HP_TcpAgent(HP_TcpAgentListener pListener)
  554. {
  555. return (HP_TcpAgent)(new C_HP_TcpAgent((ITcpAgentListener*)pListener));
  556. }
  557. HPSOCKET_API HP_TcpClient __HP_CALL Create_HP_TcpClient(HP_TcpClientListener pListener)
  558. {
  559. return (HP_TcpClient)(new C_HP_TcpClient((ITcpClientListener*)pListener));
  560. }
  561. HPSOCKET_API HP_TcpPullServer __HP_CALL Create_HP_TcpPullServer(HP_TcpPullServerListener pListener)
  562. {
  563. return (HP_TcpPullServer)(new C_HP_TcpPullServer((ITcpServerListener*)pListener));
  564. }
  565. HPSOCKET_API HP_TcpPullAgent __HP_CALL Create_HP_TcpPullAgent(HP_TcpPullAgentListener pListener)
  566. {
  567. return (HP_TcpPullAgent)(new C_HP_TcpPullAgent((ITcpAgentListener*)pListener));
  568. }
  569. HPSOCKET_API HP_TcpPullClient __HP_CALL Create_HP_TcpPullClient(HP_TcpPullClientListener pListener)
  570. {
  571. return (HP_TcpPullClient)(new C_HP_TcpPullClient((ITcpClientListener*)pListener));
  572. }
  573. HPSOCKET_API HP_TcpPackServer __HP_CALL Create_HP_TcpPackServer(HP_TcpServerListener pListener)
  574. {
  575. return (HP_TcpPackServer)(new C_HP_TcpPackServer((ITcpServerListener*)pListener));
  576. }
  577. HPSOCKET_API HP_TcpPackAgent __HP_CALL Create_HP_TcpPackAgent(HP_TcpAgentListener pListener)
  578. {
  579. return (HP_TcpPackAgent)(new C_HP_TcpPackAgent((ITcpAgentListener*)pListener));
  580. }
  581. HPSOCKET_API HP_TcpPackClient __HP_CALL Create_HP_TcpPackClient(HP_TcpClientListener pListener)
  582. {
  583. return (HP_TcpPackClient)(new C_HP_TcpPackClient((ITcpClientListener*)pListener));
  584. }
  585. HPSOCKET_API HP_UdpServer __HP_CALL Create_HP_UdpServer(HP_UdpServerListener pListener)
  586. {
  587. return (HP_UdpServer)(new C_HP_UdpServer((IUdpServerListener*)pListener));
  588. }
  589. HPSOCKET_API HP_UdpClient __HP_CALL Create_HP_UdpClient(HP_UdpClientListener pListener)
  590. {
  591. return (HP_UdpClient)(new C_HP_UdpClient((IUdpClientListener*)pListener));
  592. }
  593. HPSOCKET_API HP_UdpCast __HP_CALL Create_HP_UdpCast(HP_UdpCastListener pListener)
  594. {
  595. return (HP_UdpCast)(new C_HP_UdpCast((IUdpCastListener*)pListener));
  596. }
  597. HPSOCKET_API void __HP_CALL Destroy_HP_TcpServer(HP_TcpServer pServer)
  598. {
  599. delete (C_HP_TcpServer*)pServer;
  600. }
  601. HPSOCKET_API void __HP_CALL Destroy_HP_TcpAgent(HP_TcpAgent pAgent)
  602. {
  603. delete (C_HP_TcpAgent*)pAgent;
  604. }
  605. HPSOCKET_API void __HP_CALL Destroy_HP_TcpClient(HP_TcpClient pClient)
  606. {
  607. delete (C_HP_TcpClient*)pClient;
  608. }
  609. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPullServer(HP_TcpPullServer pServer)
  610. {
  611. delete (C_HP_TcpPullServer*)pServer;
  612. }
  613. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPullAgent(HP_TcpPullAgent pAgent)
  614. {
  615. delete (C_HP_TcpPullAgent*)pAgent;
  616. }
  617. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPullClient(HP_TcpPullClient pClient)
  618. {
  619. delete (C_HP_TcpPullClient*)pClient;
  620. }
  621. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPackServer(HP_TcpPackServer pServer)
  622. {
  623. delete (C_HP_TcpPackServer*)pServer;
  624. }
  625. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPackAgent(HP_TcpPackAgent pAgent)
  626. {
  627. delete (C_HP_TcpPackAgent*)pAgent;
  628. }
  629. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPackClient(HP_TcpPackClient pClient)
  630. {
  631. delete (C_HP_TcpPackClient*)pClient;
  632. }
  633. HPSOCKET_API void __HP_CALL Destroy_HP_UdpServer(HP_UdpServer pServer)
  634. {
  635. delete (C_HP_UdpServer*)pServer;
  636. }
  637. HPSOCKET_API void __HP_CALL Destroy_HP_UdpClient(HP_UdpClient pClient)
  638. {
  639. delete (C_HP_UdpClient*)pClient;
  640. }
  641. HPSOCKET_API void __HP_CALL Destroy_HP_UdpCast(HP_UdpCast pCast)
  642. {
  643. delete (C_HP_UdpCast*)pCast;
  644. }
  645. HPSOCKET_API HP_TcpServerListener __HP_CALL Create_HP_TcpServerListener()
  646. {
  647. return (HP_TcpServerListener)(new C_HP_TcpServerListener);
  648. }
  649. HPSOCKET_API HP_TcpAgentListener __HP_CALL Create_HP_TcpAgentListener()
  650. {
  651. return (HP_TcpAgentListener)(new C_HP_TcpAgentListener);
  652. }
  653. HPSOCKET_API HP_TcpClientListener __HP_CALL Create_HP_TcpClientListener()
  654. {
  655. return (HP_TcpClientListener)(new C_HP_TcpClientListener);
  656. }
  657. HPSOCKET_API HP_TcpPullServerListener __HP_CALL Create_HP_TcpPullServerListener()
  658. {
  659. return (HP_TcpPullServerListener)(new C_HP_TcpPullServerListener);
  660. }
  661. HPSOCKET_API HP_TcpPullAgentListener __HP_CALL Create_HP_TcpPullAgentListener()
  662. {
  663. return (HP_TcpPullAgentListener)(new C_HP_TcpPullAgentListener);
  664. }
  665. HPSOCKET_API HP_TcpPullClientListener __HP_CALL Create_HP_TcpPullClientListener()
  666. {
  667. return (HP_TcpPullClientListener)(new C_HP_TcpPullClientListener);
  668. }
  669. HPSOCKET_API HP_TcpPackServerListener __HP_CALL Create_HP_TcpPackServerListener()
  670. {
  671. return (HP_TcpPackServerListener)(new C_HP_TcpPackServerListener);
  672. }
  673. HPSOCKET_API HP_TcpPackAgentListener __HP_CALL Create_HP_TcpPackAgentListener()
  674. {
  675. return (HP_TcpPackAgentListener)(new C_HP_TcpPackAgentListener);
  676. }
  677. HPSOCKET_API HP_TcpPackClientListener __HP_CALL Create_HP_TcpPackClientListener()
  678. {
  679. return (HP_TcpPackClientListener)(new C_HP_TcpPackClientListener);
  680. }
  681. HPSOCKET_API HP_UdpServerListener __HP_CALL Create_HP_UdpServerListener()
  682. {
  683. return (HP_UdpServerListener)(new C_HP_UdpServerListener);
  684. }
  685. HPSOCKET_API HP_UdpClientListener __HP_CALL Create_HP_UdpClientListener()
  686. {
  687. return (HP_UdpClientListener)(new C_HP_UdpClientListener);
  688. }
  689. HPSOCKET_API HP_UdpCastListener __HP_CALL Create_HP_UdpCastListener()
  690. {
  691. return (HP_UdpCastListener)(new C_HP_UdpCastListener);
  692. }
  693. HPSOCKET_API void __HP_CALL Destroy_HP_TcpServerListener(HP_TcpServerListener pListener)
  694. {
  695. delete (C_HP_TcpServerListener*)pListener;
  696. }
  697. HPSOCKET_API void __HP_CALL Destroy_HP_TcpAgentListener(HP_TcpAgentListener pListener)
  698. {
  699. delete (C_HP_TcpAgentListener*)pListener;
  700. }
  701. HPSOCKET_API void __HP_CALL Destroy_HP_TcpClientListener(HP_TcpClientListener pListener)
  702. {
  703. delete (C_HP_TcpClientListener*)pListener;
  704. }
  705. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPullServerListener(HP_TcpPullServerListener pListener)
  706. {
  707. delete (C_HP_TcpPullServerListener*)pListener;
  708. }
  709. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPullAgentListener(HP_TcpPullAgentListener pListener)
  710. {
  711. delete (C_HP_TcpPullAgentListener*)pListener;
  712. }
  713. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPullClientListener(HP_TcpPullClientListener pListener)
  714. {
  715. delete (C_HP_TcpPullClientListener*)pListener;
  716. }
  717. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPackServerListener(HP_TcpPackServerListener pListener)
  718. {
  719. delete (C_HP_TcpPackServerListener*)pListener;
  720. }
  721. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPackAgentListener(HP_TcpPackAgentListener pListener)
  722. {
  723. delete (C_HP_TcpPackAgentListener*)pListener;
  724. }
  725. HPSOCKET_API void __HP_CALL Destroy_HP_TcpPackClientListener(HP_TcpPackClientListener pListener)
  726. {
  727. delete (C_HP_TcpPackClientListener*)pListener;
  728. }
  729. HPSOCKET_API void __HP_CALL Destroy_HP_UdpServerListener(HP_UdpServerListener pListener)
  730. {
  731. delete (C_HP_UdpServerListener*)pListener;
  732. }
  733. HPSOCKET_API void __HP_CALL Destroy_HP_UdpClientListener(HP_UdpClientListener pListener)
  734. {
  735. delete (C_HP_UdpClientListener*)pListener;
  736. }
  737. HPSOCKET_API void __HP_CALL Destroy_HP_UdpCastListener(HP_UdpCastListener pListener)
  738. {
  739. delete (C_HP_UdpClientListener*)pListener;
  740. }
  741. /**********************************************************************************/
  742. /***************************** Server 回调函数设置方法 *****************************/
  743. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnPrepareListen(HP_ServerListener pListener, HP_FN_Server_OnPrepareListen fn)
  744. {
  745. ((C_HP_TcpServerListener*)pListener)->m_fnOnPrepareListen = fn;
  746. }
  747. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnAccept(HP_ServerListener pListener, HP_FN_Server_OnAccept fn)
  748. {
  749. ((C_HP_TcpServerListener*)pListener)->m_fnOnAccept = fn;
  750. }
  751. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnHandShake(HP_ServerListener pListener, HP_FN_Server_OnHandShake fn)
  752. {
  753. ((C_HP_TcpServerListener*)pListener)->m_fnOnHandShake = fn;
  754. }
  755. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnSend(HP_ServerListener pListener, HP_FN_Server_OnSend fn)
  756. {
  757. ((C_HP_TcpServerListener*)pListener)->m_fnOnSend = fn;
  758. }
  759. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnReceive(HP_ServerListener pListener, HP_FN_Server_OnReceive fn)
  760. {
  761. ((C_HP_TcpServerListener*)pListener)->m_fnOnReceive = fn;
  762. }
  763. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnPullReceive(HP_ServerListener pListener, HP_FN_Server_OnPullReceive fn)
  764. {
  765. ((C_HP_TcpServerListener*)pListener)->m_fnOnPullReceive = fn;
  766. }
  767. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnClose(HP_ServerListener pListener, HP_FN_Server_OnClose fn)
  768. {
  769. ((C_HP_TcpServerListener*)pListener)->m_fnOnClose = fn;
  770. }
  771. HPSOCKET_API void __HP_CALL HP_Set_FN_Server_OnShutdown(HP_ServerListener pListener, HP_FN_Server_OnShutdown fn)
  772. {
  773. ((C_HP_TcpServerListener*)pListener)->m_fnOnShutdown = fn;
  774. }
  775. /**********************************************************************************/
  776. /***************************** Agent 回调函数设置方法 *****************************/
  777. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnPrepareConnect(HP_AgentListener pListener, HP_FN_Agent_OnPrepareConnect fn)
  778. {
  779. ((C_HP_TcpAgentListener*)pListener)->m_fnOnPrepareConnect = fn;
  780. }
  781. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnConnect(HP_AgentListener pListener, HP_FN_Agent_OnConnect fn)
  782. {
  783. ((C_HP_TcpAgentListener*)pListener)->m_fnOnConnect = fn;
  784. }
  785. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnHandShake(HP_AgentListener pListener, HP_FN_Agent_OnHandShake fn)
  786. {
  787. ((C_HP_TcpAgentListener*)pListener)->m_fnOnHandShake = fn;
  788. }
  789. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnSend(HP_AgentListener pListener, HP_FN_Agent_OnSend fn)
  790. {
  791. ((C_HP_TcpAgentListener*)pListener)->m_fnOnSend = fn;
  792. }
  793. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnReceive(HP_AgentListener pListener, HP_FN_Agent_OnReceive fn)
  794. {
  795. ((C_HP_TcpAgentListener*)pListener)->m_fnOnReceive = fn;
  796. }
  797. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnPullReceive(HP_AgentListener pListener, HP_FN_Agent_OnPullReceive fn)
  798. {
  799. ((C_HP_TcpAgentListener*)pListener)->m_fnOnPullReceive = fn;
  800. }
  801. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnClose(HP_AgentListener pListener, HP_FN_Agent_OnClose fn)
  802. {
  803. ((C_HP_TcpAgentListener*)pListener)->m_fnOnClose = fn;
  804. }
  805. HPSOCKET_API void __HP_CALL HP_Set_FN_Agent_OnShutdown(HP_AgentListener pListener, HP_FN_Agent_OnShutdown fn)
  806. {
  807. ((C_HP_TcpAgentListener*)pListener)->m_fnOnShutdown = fn;
  808. }
  809. /**********************************************************************************/
  810. /***************************** Client 回调函数设置方法 *****************************/
  811. HPSOCKET_API void __HP_CALL HP_Set_FN_Client_OnPrepareConnect(HP_ClientListener pListener, HP_FN_Client_OnPrepareConnect fn)
  812. {
  813. ((C_HP_TcpClientListener*)pListener)->m_fnOnPrepareConnect = fn;
  814. }
  815. HPSOCKET_API void __HP_CALL HP_Set_FN_Client_OnConnect(HP_ClientListener pListener, HP_FN_Client_OnConnect fn)
  816. {
  817. ((C_HP_TcpClientListener*)pListener)->m_fnOnConnect = fn;
  818. }
  819. HPSOCKET_API void __HP_CALL HP_Set_FN_Client_OnHandShake(HP_ClientListener pListener, HP_FN_Client_OnHandShake fn)
  820. {
  821. ((C_HP_TcpClientListener*)pListener)->m_fnOnHandShake = fn;
  822. }
  823. HPSOCKET_API void __HP_CALL HP_Set_FN_Client_OnSend(HP_ClientListener pListener, HP_FN_Client_OnSend fn)
  824. {
  825. ((C_HP_TcpClientListener*)pListener)->m_fnOnSend = fn;
  826. }
  827. HPSOCKET_API void __HP_CALL HP_Set_FN_Client_OnReceive(HP_ClientListener pListener, HP_FN_Client_OnReceive fn)
  828. {
  829. ((C_HP_TcpClientListener*)pListener)->m_fnOnReceive = fn;
  830. }
  831. HPSOCKET_API void __HP_CALL HP_Set_FN_Client_OnPullReceive(HP_ClientListener pListener, HP_FN_Client_OnPullReceive fn)
  832. {
  833. ((C_HP_TcpClientListener*)pListener)->m_fnOnPullReceive = fn;
  834. }
  835. HPSOCKET_API void __HP_CALL HP_Set_FN_Client_OnClose(HP_ClientListener pListener, HP_FN_Client_OnClose fn)
  836. {
  837. ((C_HP_TcpClientListener*)pListener)->m_fnOnClose = fn;
  838. }
  839. /**************************************************************************/
  840. /***************************** Server 操作方法 *****************************/
  841. HPSOCKET_API BOOL __HP_CALL HP_Server_Start(HP_Server pServer, LPCTSTR lpszBindAddress, USHORT usPort)
  842. {
  843. return C_HP_Object::ToSecond<IServer>(pServer)->Start(lpszBindAddress, usPort);
  844. }
  845. HPSOCKET_API BOOL __HP_CALL HP_Server_Stop(HP_Server pServer)
  846. {
  847. return C_HP_Object::ToSecond<IServer>(pServer)->Stop();
  848. }
  849. HPSOCKET_API BOOL __HP_CALL HP_Server_Send(HP_Server pServer, HP_CONNID dwConnID, const BYTE* pBuffer, int iLength)
  850. {
  851. return C_HP_Object::ToSecond<IServer>(pServer)->Send(dwConnID, pBuffer, iLength);
  852. }
  853. HPSOCKET_API BOOL __HP_CALL HP_Server_SendPart(HP_Server pServer, HP_CONNID dwConnID, const BYTE* pBuffer, int iLength, int iOffset)
  854. {
  855. return C_HP_Object::ToSecond<IServer>(pServer)->Send(dwConnID, pBuffer, iLength, iOffset);
  856. }
  857. HPSOCKET_API BOOL __HP_CALL HP_Server_SendPackets(HP_Server pServer, HP_CONNID dwConnID, const WSABUF pBuffers[], int iCount)
  858. {
  859. return C_HP_Object::ToSecond<IServer>(pServer)->SendPackets(dwConnID, pBuffers, iCount);
  860. }
  861. HPSOCKET_API BOOL __HP_CALL HP_Server_PauseReceive(HP_Server pServer, HP_CONNID dwConnID, BOOL bPause)
  862. {
  863. return C_HP_Object::ToSecond<IServer>(pServer)->PauseReceive(dwConnID, bPause);
  864. }
  865. HPSOCKET_API BOOL __HP_CALL HP_Server_Disconnect(HP_Server pServer, HP_CONNID dwConnID, BOOL bForce)
  866. {
  867. return C_HP_Object::ToSecond<IServer>(pServer)->Disconnect(dwConnID, bForce);
  868. }
  869. HPSOCKET_API BOOL __HP_CALL HP_Server_DisconnectLongConnections(HP_Server pServer, DWORD dwPeriod, BOOL bForce)
  870. {
  871. return C_HP_Object::ToSecond<IServer>(pServer)->DisconnectLongConnections(dwPeriod, bForce);
  872. }
  873. HPSOCKET_API BOOL __HP_CALL HP_Server_DisconnectSilenceConnections(HP_Server pServer, DWORD dwPeriod, BOOL bForce)
  874. {
  875. return C_HP_Object::ToSecond<IServer>(pServer)->DisconnectSilenceConnections(dwPeriod, bForce);
  876. }
  877. /******************************************************************************/
  878. /***************************** Server 属性访问方法 *****************************/
  879. HPSOCKET_API BOOL __HP_CALL HP_Server_SetConnectionExtra(HP_Server pServer, HP_CONNID dwConnID, PVOID pExtra)
  880. {
  881. return C_HP_Object::ToSecond<IServer>(pServer)->SetConnectionExtra(dwConnID, pExtra);
  882. }
  883. HPSOCKET_API BOOL __HP_CALL HP_Server_GetConnectionExtra(HP_Server pServer, HP_CONNID dwConnID, PVOID* ppExtra)
  884. {
  885. return C_HP_Object::ToSecond<IServer>(pServer)->GetConnectionExtra(dwConnID, ppExtra);
  886. }
  887. HPSOCKET_API BOOL __HP_CALL HP_Server_IsSecure(HP_Server pServer)
  888. {
  889. return C_HP_Object::ToSecond<IServer>(pServer)->IsSecure();
  890. }
  891. HPSOCKET_API BOOL __HP_CALL HP_Server_HasStarted(HP_Server pServer)
  892. {
  893. return C_HP_Object::ToSecond<IServer>(pServer)->HasStarted();
  894. }
  895. HPSOCKET_API En_HP_ServiceState __HP_CALL HP_Server_GetState(HP_Server pServer)
  896. {
  897. return C_HP_Object::ToSecond<IServer>(pServer)->GetState();
  898. }
  899. HPSOCKET_API En_HP_SocketError __HP_CALL HP_Server_GetLastError(HP_Server pServer)
  900. {
  901. return C_HP_Object::ToSecond<IServer>(pServer)->GetLastError();
  902. }
  903. HPSOCKET_API LPCTSTR __HP_CALL HP_Server_GetLastErrorDesc(HP_Server pServer)
  904. {
  905. return C_HP_Object::ToSecond<IServer>(pServer)->GetLastErrorDesc();
  906. }
  907. HPSOCKET_API BOOL __HP_CALL HP_Server_GetPendingDataLength(HP_Server pServer, HP_CONNID dwConnID, int* piPending)
  908. {
  909. return C_HP_Object::ToSecond<IServer>(pServer)->GetPendingDataLength(dwConnID, *piPending);
  910. }
  911. HPSOCKET_API BOOL __HP_CALL HP_Server_IsPauseReceive(HP_Server pServer, HP_CONNID dwConnID, BOOL* pbPaused)
  912. {
  913. return C_HP_Object::ToSecond<IServer>(pServer)->IsPauseReceive(dwConnID, *pbPaused);
  914. }
  915. HPSOCKET_API DWORD __HP_CALL HP_Server_GetConnectionCount(HP_Server pServer)
  916. {
  917. return C_HP_Object::ToSecond<IServer>(pServer)->GetConnectionCount();
  918. }
  919. HPSOCKET_API BOOL __HP_CALL HP_Server_GetAllConnectionIDs(HP_Server pServer, HP_CONNID pIDs[], DWORD* pdwCount)
  920. {
  921. return C_HP_Object::ToSecond<IServer>(pServer)->GetAllConnectionIDs(pIDs, *pdwCount);
  922. }
  923. HPSOCKET_API BOOL __HP_CALL HP_Server_GetConnectPeriod(HP_Server pServer, HP_CONNID dwConnID, DWORD* pdwPeriod)
  924. {
  925. return C_HP_Object::ToSecond<IServer>(pServer)->GetConnectPeriod(dwConnID, *pdwPeriod);
  926. }
  927. HPSOCKET_API BOOL __HP_CALL HP_Server_GetSilencePeriod(HP_Server pServer, HP_CONNID dwConnID, DWORD* pdwPeriod)
  928. {
  929. return C_HP_Object::ToSecond<IServer>(pServer)->GetSilencePeriod(dwConnID, *pdwPeriod);
  930. }
  931. HPSOCKET_API BOOL __HP_CALL HP_Server_GetListenAddress(HP_Server pServer, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  932. {
  933. return C_HP_Object::ToSecond<IServer>(pServer)->GetListenAddress(lpszAddress, *piAddressLen, *pusPort);
  934. }
  935. HPSOCKET_API BOOL __HP_CALL HP_Server_GetLocalAddress(HP_Server pServer, HP_CONNID dwConnID, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  936. {
  937. return C_HP_Object::ToSecond<IServer>(pServer)->GetLocalAddress(dwConnID, lpszAddress, *piAddressLen, *pusPort);
  938. }
  939. HPSOCKET_API BOOL __HP_CALL HP_Server_GetRemoteAddress(HP_Server pServer, HP_CONNID dwConnID, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  940. {
  941. return C_HP_Object::ToSecond<IServer>(pServer)->GetRemoteAddress(dwConnID, lpszAddress, *piAddressLen, *pusPort);
  942. }
  943. HPSOCKET_API void __HP_CALL HP_Server_SetSendPolicy(HP_Server pServer, En_HP_SendPolicy enSendPolicy)
  944. {
  945. C_HP_Object::ToSecond<IServer>(pServer)->SetSendPolicy(enSendPolicy);
  946. }
  947. HPSOCKET_API void __HP_CALL HP_Server_SetFreeSocketObjLockTime(HP_Server pServer, DWORD dwFreeSocketObjLockTime)
  948. {
  949. C_HP_Object::ToSecond<IServer>(pServer)->SetFreeSocketObjLockTime(dwFreeSocketObjLockTime);
  950. }
  951. HPSOCKET_API void __HP_CALL HP_Server_SetFreeSocketObjPool(HP_Server pServer, DWORD dwFreeSocketObjPool)
  952. {
  953. C_HP_Object::ToSecond<IServer>(pServer)->SetFreeSocketObjPool(dwFreeSocketObjPool);
  954. }
  955. HPSOCKET_API void __HP_CALL HP_Server_SetFreeBufferObjPool(HP_Server pServer, DWORD dwFreeBufferObjPool)
  956. {
  957. C_HP_Object::ToSecond<IServer>(pServer)->SetFreeBufferObjPool(dwFreeBufferObjPool);
  958. }
  959. HPSOCKET_API void __HP_CALL HP_Server_SetFreeSocketObjHold(HP_Server pServer, DWORD dwFreeSocketObjHold)
  960. {
  961. C_HP_Object::ToSecond<IServer>(pServer)->SetFreeSocketObjHold(dwFreeSocketObjHold);
  962. }
  963. HPSOCKET_API void __HP_CALL HP_Server_SetFreeBufferObjHold(HP_Server pServer, DWORD dwFreeBufferObjHold)
  964. {
  965. C_HP_Object::ToSecond<IServer>(pServer)->SetFreeBufferObjHold(dwFreeBufferObjHold);
  966. }
  967. HPSOCKET_API void __HP_CALL HP_Server_SetMaxConnectionCount(HP_Server pServer, DWORD dwMaxConnectionCount)
  968. {
  969. C_HP_Object::ToSecond<IServer>(pServer)->SetMaxConnectionCount(dwMaxConnectionCount);
  970. }
  971. HPSOCKET_API void __HP_CALL HP_Server_SetWorkerThreadCount(HP_Server pServer, DWORD dwWorkerThreadCount)
  972. {
  973. C_HP_Object::ToSecond<IServer>(pServer)->SetWorkerThreadCount(dwWorkerThreadCount);
  974. }
  975. HPSOCKET_API void __HP_CALL HP_Server_SetMarkSilence(HP_Server pServer, BOOL bMarkSilence)
  976. {
  977. C_HP_Object::ToSecond<IServer>(pServer)->SetMarkSilence(bMarkSilence);
  978. }
  979. HPSOCKET_API En_HP_SendPolicy __HP_CALL HP_Server_GetSendPolicy(HP_Server pServer)
  980. {
  981. return C_HP_Object::ToSecond<IServer>(pServer)->GetSendPolicy();
  982. }
  983. HPSOCKET_API DWORD __HP_CALL HP_Server_GetFreeSocketObjLockTime(HP_Server pServer)
  984. {
  985. return C_HP_Object::ToSecond<IServer>(pServer)->GetFreeSocketObjLockTime();
  986. }
  987. HPSOCKET_API DWORD __HP_CALL HP_Server_GetFreeSocketObjPool(HP_Server pServer)
  988. {
  989. return C_HP_Object::ToSecond<IServer>(pServer)->GetFreeSocketObjPool();
  990. }
  991. HPSOCKET_API DWORD __HP_CALL HP_Server_GetFreeBufferObjPool(HP_Server pServer)
  992. {
  993. return C_HP_Object::ToSecond<IServer>(pServer)->GetFreeBufferObjPool();
  994. }
  995. HPSOCKET_API DWORD __HP_CALL HP_Server_GetFreeSocketObjHold(HP_Server pServer)
  996. {
  997. return C_HP_Object::ToSecond<IServer>(pServer)->GetFreeSocketObjHold();
  998. }
  999. HPSOCKET_API DWORD __HP_CALL HP_Server_GetFreeBufferObjHold(HP_Server pServer)
  1000. {
  1001. return C_HP_Object::ToSecond<IServer>(pServer)->GetFreeBufferObjHold();
  1002. }
  1003. HPSOCKET_API DWORD __HP_CALL HP_Server_GetMaxConnectionCount(HP_Server pServer)
  1004. {
  1005. return C_HP_Object::ToSecond<IServer>(pServer)->GetMaxConnectionCount();
  1006. }
  1007. HPSOCKET_API DWORD __HP_CALL HP_Server_GetWorkerThreadCount(HP_Server pServer)
  1008. {
  1009. return C_HP_Object::ToSecond<IServer>(pServer)->GetWorkerThreadCount();
  1010. }
  1011. HPSOCKET_API BOOL __HP_CALL HP_Server_IsMarkSilence(HP_Server pServer)
  1012. {
  1013. return C_HP_Object::ToSecond<IServer>(pServer)->IsMarkSilence();
  1014. }
  1015. /**********************************************************************************/
  1016. /******************************* TCP Server 操作方法 *******************************/
  1017. HPSOCKET_API BOOL __HP_CALL HP_TcpServer_SendSmallFile(HP_Server pServer, HP_CONNID dwConnID, LPCTSTR lpszFileName, const LPWSABUF pHead, const LPWSABUF pTail)
  1018. {
  1019. return C_HP_Object::ToSecond<ITcpServer>(pServer)->SendSmallFile(dwConnID, lpszFileName, pHead, pTail);
  1020. }
  1021. /**********************************************************************************/
  1022. /***************************** TCP Server 属性访问方法 *****************************/
  1023. HPSOCKET_API void __HP_CALL HP_TcpServer_SetAcceptSocketCount(HP_TcpServer pServer, DWORD dwAcceptSocketCount)
  1024. {
  1025. C_HP_Object::ToSecond<ITcpServer>(pServer)->SetAcceptSocketCount(dwAcceptSocketCount);
  1026. }
  1027. HPSOCKET_API void __HP_CALL HP_TcpServer_SetSocketBufferSize(HP_TcpServer pServer, DWORD dwSocketBufferSize)
  1028. {
  1029. C_HP_Object::ToSecond<ITcpServer>(pServer)->SetSocketBufferSize(dwSocketBufferSize);
  1030. }
  1031. HPSOCKET_API void __HP_CALL HP_TcpServer_SetSocketListenQueue(HP_TcpServer pServer, DWORD dwSocketListenQueue)
  1032. {
  1033. C_HP_Object::ToSecond<ITcpServer>(pServer)->SetSocketListenQueue(dwSocketListenQueue);
  1034. }
  1035. HPSOCKET_API void __HP_CALL HP_TcpServer_SetKeepAliveTime(HP_TcpServer pServer, DWORD dwKeepAliveTime)
  1036. {
  1037. C_HP_Object::ToSecond<ITcpServer>(pServer)->SetKeepAliveTime(dwKeepAliveTime);
  1038. }
  1039. HPSOCKET_API void __HP_CALL HP_TcpServer_SetKeepAliveInterval(HP_TcpServer pServer, DWORD dwKeepAliveInterval)
  1040. {
  1041. C_HP_Object::ToSecond<ITcpServer>(pServer)->SetKeepAliveInterval(dwKeepAliveInterval);
  1042. }
  1043. HPSOCKET_API DWORD __HP_CALL HP_TcpServer_GetAcceptSocketCount(HP_TcpServer pServer)
  1044. {
  1045. return C_HP_Object::ToSecond<ITcpServer>(pServer)->GetAcceptSocketCount();
  1046. }
  1047. HPSOCKET_API DWORD __HP_CALL HP_TcpServer_GetSocketBufferSize(HP_TcpServer pServer)
  1048. {
  1049. return C_HP_Object::ToSecond<ITcpServer>(pServer)->GetSocketBufferSize();
  1050. }
  1051. HPSOCKET_API DWORD __HP_CALL HP_TcpServer_GetSocketListenQueue(HP_TcpServer pServer)
  1052. {
  1053. return C_HP_Object::ToSecond<ITcpServer>(pServer)->GetSocketListenQueue();
  1054. }
  1055. HPSOCKET_API DWORD __HP_CALL HP_TcpServer_GetKeepAliveTime(HP_TcpServer pServer)
  1056. {
  1057. return C_HP_Object::ToSecond<ITcpServer>(pServer)->GetKeepAliveTime();
  1058. }
  1059. HPSOCKET_API DWORD __HP_CALL HP_TcpServer_GetKeepAliveInterval(HP_TcpServer pServer)
  1060. {
  1061. return C_HP_Object::ToSecond<ITcpServer>(pServer)->GetKeepAliveInterval();
  1062. }
  1063. /**********************************************************************************/
  1064. /***************************** UDP Server 属性访问方法 *****************************/
  1065. HPSOCKET_API void __HP_CALL HP_UdpServer_SetMaxDatagramSize(HP_UdpServer pServer, DWORD dwMaxDatagramSize)
  1066. {
  1067. C_HP_Object::ToSecond<IUdpServer>(pServer)->SetMaxDatagramSize(dwMaxDatagramSize);
  1068. }
  1069. HPSOCKET_API DWORD __HP_CALL HP_UdpServer_GetMaxDatagramSize(HP_UdpServer pServer)
  1070. {
  1071. return C_HP_Object::ToSecond<IUdpServer>(pServer)->GetMaxDatagramSize();
  1072. }
  1073. HPSOCKET_API void __HP_CALL HP_UdpServer_SetPostReceiveCount(HP_UdpServer pServer, DWORD dwPostReceiveCount)
  1074. {
  1075. C_HP_Object::ToSecond<IUdpServer>(pServer)->SetPostReceiveCount(dwPostReceiveCount);
  1076. }
  1077. HPSOCKET_API DWORD __HP_CALL HP_UdpServer_GetPostReceiveCount(HP_UdpServer pServer)
  1078. {
  1079. return C_HP_Object::ToSecond<IUdpServer>(pServer)->GetPostReceiveCount();
  1080. }
  1081. HPSOCKET_API void __HP_CALL HP_UdpServer_SetDetectAttempts(HP_UdpServer pServer, DWORD dwDetectAttempts)
  1082. {
  1083. C_HP_Object::ToSecond<IUdpServer>(pServer)->SetDetectAttempts(dwDetectAttempts);
  1084. }
  1085. HPSOCKET_API void __HP_CALL HP_UdpServer_SetDetectInterval(HP_UdpServer pServer, DWORD dwDetectInterval)
  1086. {
  1087. C_HP_Object::ToSecond<IUdpServer>(pServer)->SetDetectInterval(dwDetectInterval);
  1088. }
  1089. HPSOCKET_API DWORD __HP_CALL HP_UdpServer_GetDetectAttempts(HP_UdpServer pServer)
  1090. {
  1091. return C_HP_Object::ToSecond<IUdpServer>(pServer)->GetDetectAttempts();
  1092. }
  1093. HPSOCKET_API DWORD __HP_CALL HP_UdpServer_GetDetectInterval(HP_UdpServer pServer)
  1094. {
  1095. return C_HP_Object::ToSecond<IUdpServer>(pServer)->GetDetectInterval();
  1096. }
  1097. /**************************************************************************/
  1098. /***************************** Agent 操作方法 *****************************/
  1099. HPSOCKET_API BOOL __HP_CALL HP_Agent_Start(HP_Agent pAgent, LPCTSTR lpszBindAddress, BOOL bAsyncConnect)
  1100. {
  1101. return C_HP_Object::ToSecond<IAgent>(pAgent)->Start(lpszBindAddress, bAsyncConnect);
  1102. }
  1103. HPSOCKET_API BOOL __HP_CALL HP_Agent_Stop(HP_Agent pAgent)
  1104. {
  1105. return C_HP_Object::ToSecond<IAgent>(pAgent)->Stop();
  1106. }
  1107. HPSOCKET_API BOOL __HP_CALL HP_Agent_Connect(HP_Agent pAgent, LPCTSTR lpszRemoteAddress, USHORT usPort, HP_CONNID* pdwConnID)
  1108. {
  1109. return C_HP_Object::ToSecond<IAgent>(pAgent)->Connect(lpszRemoteAddress, usPort, pdwConnID);
  1110. }
  1111. HPSOCKET_API BOOL __HP_CALL HP_Agent_ConnectWithExtra(HP_Agent pAgent, LPCTSTR lpszRemoteAddress, USHORT usPort, HP_CONNID* pdwConnID, PVOID pExtra)
  1112. {
  1113. return C_HP_Object::ToSecond<IAgent>(pAgent)->Connect(lpszRemoteAddress, usPort, pdwConnID, pExtra);
  1114. }
  1115. HPSOCKET_API BOOL __HP_CALL HP_Agent_Send(HP_Agent pAgent, HP_CONNID dwConnID, const BYTE* pBuffer, int iLength)
  1116. {
  1117. return C_HP_Object::ToSecond<IAgent>(pAgent)->Send(dwConnID, pBuffer, iLength);
  1118. }
  1119. HPSOCKET_API BOOL __HP_CALL HP_Agent_SendPart(HP_Agent pAgent, HP_CONNID dwConnID, const BYTE* pBuffer, int iLength, int iOffset)
  1120. {
  1121. return C_HP_Object::ToSecond<IAgent>(pAgent)->Send(dwConnID, pBuffer, iLength, iOffset);
  1122. }
  1123. HPSOCKET_API BOOL __HP_CALL HP_Agent_SendPackets(HP_Agent pAgent, HP_CONNID dwConnID, const WSABUF pBuffers[], int iCount)
  1124. {
  1125. return C_HP_Object::ToSecond<IAgent>(pAgent)->SendPackets(dwConnID, pBuffers, iCount);
  1126. }
  1127. HPSOCKET_API BOOL __HP_CALL HP_Agent_PauseReceive(HP_Agent pAgent, HP_CONNID dwConnID, BOOL bPause)
  1128. {
  1129. return C_HP_Object::ToSecond<IAgent>(pAgent)->PauseReceive(dwConnID, bPause);
  1130. }
  1131. HPSOCKET_API BOOL __HP_CALL HP_Agent_Disconnect(HP_Agent pAgent, HP_CONNID dwConnID, BOOL bForce)
  1132. {
  1133. return C_HP_Object::ToSecond<IAgent>(pAgent)->Disconnect(dwConnID, bForce);
  1134. }
  1135. HPSOCKET_API BOOL __HP_CALL HP_Agent_DisconnectLongConnections(HP_Agent pAgent, DWORD dwPeriod, BOOL bForce)
  1136. {
  1137. return C_HP_Object::ToSecond<IAgent>(pAgent)->DisconnectLongConnections(dwPeriod, bForce);
  1138. }
  1139. HPSOCKET_API BOOL __HP_CALL HP_Agent_DisconnectSilenceConnections(HP_Agent pAgent, DWORD dwPeriod, BOOL bForce)
  1140. {
  1141. return C_HP_Object::ToSecond<IAgent>(pAgent)->DisconnectSilenceConnections(dwPeriod, bForce);
  1142. }
  1143. /******************************************************************************/
  1144. /***************************** Agent 属性访问方法 *****************************/
  1145. HPSOCKET_API BOOL __HP_CALL HP_Agent_SetConnectionExtra(HP_Agent pAgent, HP_CONNID dwConnID, PVOID pExtra)
  1146. {
  1147. return C_HP_Object::ToSecond<IAgent>(pAgent)->SetConnectionExtra(dwConnID, pExtra);
  1148. }
  1149. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetConnectionExtra(HP_Agent pAgent, HP_CONNID dwConnID, PVOID* ppExtra)
  1150. {
  1151. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetConnectionExtra(dwConnID, ppExtra);
  1152. }
  1153. HPSOCKET_API BOOL __HP_CALL HP_Agent_IsSecure(HP_Agent pAgent)
  1154. {
  1155. return C_HP_Object::ToSecond<IAgent>(pAgent)->IsSecure();
  1156. }
  1157. HPSOCKET_API BOOL __HP_CALL HP_Agent_HasStarted(HP_Agent pAgent)
  1158. {
  1159. return C_HP_Object::ToSecond<IAgent>(pAgent)->HasStarted();
  1160. }
  1161. HPSOCKET_API En_HP_ServiceState __HP_CALL HP_Agent_GetState(HP_Agent pAgent)
  1162. {
  1163. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetState();
  1164. }
  1165. HPSOCKET_API En_HP_SocketError __HP_CALL HP_Agent_GetLastError(HP_Agent pAgent)
  1166. {
  1167. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetLastError();
  1168. }
  1169. HPSOCKET_API LPCTSTR __HP_CALL HP_Agent_GetLastErrorDesc(HP_Agent pAgent)
  1170. {
  1171. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetLastErrorDesc();
  1172. }
  1173. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetPendingDataLength(HP_Agent pAgent, HP_CONNID dwConnID, int* piPending)
  1174. {
  1175. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetPendingDataLength(dwConnID, *piPending);
  1176. }
  1177. HPSOCKET_API BOOL __HP_CALL HP_Agent_IsPauseReceive(HP_Agent pAgent, HP_CONNID dwConnID, BOOL* pbPaused)
  1178. {
  1179. return C_HP_Object::ToSecond<IAgent>(pAgent)->IsPauseReceive(dwConnID, *pbPaused);
  1180. }
  1181. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetConnectionCount(HP_Agent pAgent)
  1182. {
  1183. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetConnectionCount();
  1184. }
  1185. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetAllConnectionIDs(HP_Agent pAgent, HP_CONNID pIDs[], DWORD* pdwCount)
  1186. {
  1187. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetAllConnectionIDs(pIDs, *pdwCount);
  1188. }
  1189. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetConnectPeriod(HP_Agent pAgent, HP_CONNID dwConnID, DWORD* pdwPeriod)
  1190. {
  1191. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetConnectPeriod(dwConnID, *pdwPeriod);
  1192. }
  1193. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetSilencePeriod(HP_Agent pAgent, HP_CONNID dwConnID, DWORD* pdwPeriod)
  1194. {
  1195. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetSilencePeriod(dwConnID, *pdwPeriod);
  1196. }
  1197. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetLocalAddress(HP_Agent pAgent, HP_CONNID dwConnID, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  1198. {
  1199. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetLocalAddress(dwConnID, lpszAddress, *piAddressLen, *pusPort);
  1200. }
  1201. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetRemoteAddress(HP_Agent pAgent, HP_CONNID dwConnID, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  1202. {
  1203. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetRemoteAddress(dwConnID, lpszAddress, *piAddressLen, *pusPort);
  1204. }
  1205. HPSOCKET_API BOOL __HP_CALL HP_Agent_GetRemoteHost(HP_Agent pAgent, HP_CONNID dwConnID, TCHAR lpszHost[], int* piHostLen, USHORT* pusPort)
  1206. {
  1207. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetRemoteHost(dwConnID, lpszHost, *piHostLen, *pusPort);
  1208. }
  1209. HPSOCKET_API void __HP_CALL HP_Agent_SetSendPolicy(HP_Agent pAgent, En_HP_SendPolicy enSendPolicy)
  1210. {
  1211. C_HP_Object::ToSecond<IAgent>(pAgent)->SetSendPolicy(enSendPolicy);
  1212. }
  1213. HPSOCKET_API void __HP_CALL HP_Agent_SetFreeSocketObjLockTime(HP_Agent pAgent, DWORD dwFreeSocketObjLockTime)
  1214. {
  1215. C_HP_Object::ToSecond<IAgent>(pAgent)->SetFreeSocketObjLockTime(dwFreeSocketObjLockTime);
  1216. }
  1217. HPSOCKET_API void __HP_CALL HP_Agent_SetFreeSocketObjPool(HP_Agent pAgent, DWORD dwFreeSocketObjPool)
  1218. {
  1219. C_HP_Object::ToSecond<IAgent>(pAgent)->SetFreeSocketObjPool(dwFreeSocketObjPool);
  1220. }
  1221. HPSOCKET_API void __HP_CALL HP_Agent_SetFreeBufferObjPool(HP_Agent pAgent, DWORD dwFreeBufferObjPool)
  1222. {
  1223. C_HP_Object::ToSecond<IAgent>(pAgent)->SetFreeBufferObjPool(dwFreeBufferObjPool);
  1224. }
  1225. HPSOCKET_API void __HP_CALL HP_Agent_SetFreeSocketObjHold(HP_Agent pAgent, DWORD dwFreeSocketObjHold)
  1226. {
  1227. C_HP_Object::ToSecond<IAgent>(pAgent)->SetFreeSocketObjHold(dwFreeSocketObjHold);
  1228. }
  1229. HPSOCKET_API void __HP_CALL HP_Agent_SetFreeBufferObjHold(HP_Agent pAgent, DWORD dwFreeBufferObjHold)
  1230. {
  1231. C_HP_Object::ToSecond<IAgent>(pAgent)->SetFreeBufferObjHold(dwFreeBufferObjHold);
  1232. }
  1233. HPSOCKET_API void __HP_CALL HP_Agent_SetMaxConnectionCount(HP_Agent pAgent, DWORD dwMaxConnectionCount)
  1234. {
  1235. C_HP_Object::ToSecond<IAgent>(pAgent)->SetMaxConnectionCount(dwMaxConnectionCount);
  1236. }
  1237. HPSOCKET_API void __HP_CALL HP_Agent_SetWorkerThreadCount(HP_Agent pAgent, DWORD dwWorkerThreadCount)
  1238. {
  1239. C_HP_Object::ToSecond<IAgent>(pAgent)->SetWorkerThreadCount(dwWorkerThreadCount);
  1240. }
  1241. HPSOCKET_API void __HP_CALL HP_Agent_SetMarkSilence(HP_Agent pAgent, BOOL bMarkSilence)
  1242. {
  1243. C_HP_Object::ToSecond<IAgent>(pAgent)->SetMarkSilence(bMarkSilence);
  1244. }
  1245. HPSOCKET_API En_HP_SendPolicy __HP_CALL HP_Agent_GetSendPolicy(HP_Agent pAgent)
  1246. {
  1247. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetSendPolicy();
  1248. }
  1249. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetFreeSocketObjLockTime(HP_Agent pAgent)
  1250. {
  1251. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetFreeSocketObjLockTime();
  1252. }
  1253. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetFreeSocketObjPool(HP_Agent pAgent)
  1254. {
  1255. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetFreeSocketObjPool();
  1256. }
  1257. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetFreeBufferObjPool(HP_Agent pAgent)
  1258. {
  1259. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetFreeBufferObjPool();
  1260. }
  1261. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetFreeSocketObjHold(HP_Agent pAgent)
  1262. {
  1263. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetFreeSocketObjHold();
  1264. }
  1265. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetFreeBufferObjHold(HP_Agent pAgent)
  1266. {
  1267. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetFreeBufferObjHold();
  1268. }
  1269. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetMaxConnectionCount(HP_Agent pAgent)
  1270. {
  1271. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetMaxConnectionCount();
  1272. }
  1273. HPSOCKET_API DWORD __HP_CALL HP_Agent_GetWorkerThreadCount(HP_Agent pAgent)
  1274. {
  1275. return C_HP_Object::ToSecond<IAgent>(pAgent)->GetWorkerThreadCount();
  1276. }
  1277. HPSOCKET_API BOOL __HP_CALL HP_Agent_IsMarkSilence(HP_Agent pAgent)
  1278. {
  1279. return C_HP_Object::ToSecond<IAgent>(pAgent)->IsMarkSilence();
  1280. }
  1281. /**********************************************************************************/
  1282. /******************************* TCP Agent 操作方法 *******************************/
  1283. HPSOCKET_API BOOL __HP_CALL HP_TcpAgent_SendSmallFile(HP_Agent pAgent, HP_CONNID dwConnID, LPCTSTR lpszFileName, const LPWSABUF pHead, const LPWSABUF pTail)
  1284. {
  1285. return C_HP_Object::ToSecond<ITcpAgent>(pAgent)->SendSmallFile(dwConnID, lpszFileName, pHead, pTail);
  1286. }
  1287. /**********************************************************************************/
  1288. /***************************** TCP Agent 属性访问方法 *****************************/
  1289. HPSOCKET_API void __HP_CALL HP_TcpAgent_SetReuseAddress(HP_TcpAgent pAgent, BOOL bReuseAddress)
  1290. {
  1291. C_HP_Object::ToSecond<ITcpAgent>(pAgent)->SetReuseAddress(bReuseAddress);
  1292. }
  1293. HPSOCKET_API BOOL __HP_CALL HP_TcpAgent_IsReuseAddress(HP_TcpAgent pAgent)
  1294. {
  1295. return C_HP_Object::ToSecond<ITcpAgent>(pAgent)->IsReuseAddress();
  1296. }
  1297. HPSOCKET_API void __HP_CALL HP_TcpAgent_SetSocketBufferSize(HP_TcpAgent pAgent, DWORD dwSocketBufferSize)
  1298. {
  1299. C_HP_Object::ToSecond<ITcpAgent>(pAgent)->SetSocketBufferSize(dwSocketBufferSize);
  1300. }
  1301. HPSOCKET_API void __HP_CALL HP_TcpAgent_SetKeepAliveTime(HP_TcpAgent pAgent, DWORD dwKeepAliveTime)
  1302. {
  1303. C_HP_Object::ToSecond<ITcpAgent>(pAgent)->SetKeepAliveTime(dwKeepAliveTime);
  1304. }
  1305. HPSOCKET_API void __HP_CALL HP_TcpAgent_SetKeepAliveInterval(HP_TcpAgent pAgent, DWORD dwKeepAliveInterval)
  1306. {
  1307. C_HP_Object::ToSecond<ITcpAgent>(pAgent)->SetKeepAliveInterval(dwKeepAliveInterval);
  1308. }
  1309. HPSOCKET_API DWORD __HP_CALL HP_TcpAgent_GetSocketBufferSize(HP_TcpAgent pAgent)
  1310. {
  1311. return C_HP_Object::ToSecond<ITcpAgent>(pAgent)->GetSocketBufferSize();
  1312. }
  1313. HPSOCKET_API DWORD __HP_CALL HP_TcpAgent_GetKeepAliveTime(HP_TcpAgent pAgent)
  1314. {
  1315. return C_HP_Object::ToSecond<ITcpAgent>(pAgent)->GetKeepAliveTime();
  1316. }
  1317. HPSOCKET_API DWORD __HP_CALL HP_TcpAgent_GetKeepAliveInterval(HP_TcpAgent pAgent)
  1318. {
  1319. return C_HP_Object::ToSecond<ITcpAgent>(pAgent)->GetKeepAliveInterval();
  1320. }
  1321. /******************************************************************************/
  1322. /***************************** Client 组件操作方法 *****************************/
  1323. HPSOCKET_API BOOL __HP_CALL HP_Client_Start(HP_Client pClient, LPCTSTR lpszRemoteAddress, USHORT usPort, BOOL bAsyncConnect)
  1324. {
  1325. return C_HP_Object::ToSecond<IClient>(pClient)->Start(lpszRemoteAddress, usPort, bAsyncConnect);
  1326. }
  1327. HPSOCKET_API BOOL __HP_CALL HP_Client_StartWithBindAddress(HP_Client pClient, LPCTSTR lpszRemoteAddress, USHORT usPort, BOOL bAsyncConnect, LPCTSTR lpszBindAddress)
  1328. {
  1329. return C_HP_Object::ToSecond<IClient>(pClient)->Start(lpszRemoteAddress, usPort, bAsyncConnect, lpszBindAddress);
  1330. }
  1331. HPSOCKET_API BOOL __HP_CALL HP_Client_Stop(HP_Client pClient)
  1332. {
  1333. return C_HP_Object::ToSecond<IClient>(pClient)->Stop();
  1334. }
  1335. HPSOCKET_API BOOL __HP_CALL HP_Client_Send(HP_Client pClient, const BYTE* pBuffer, int iLength)
  1336. {
  1337. return C_HP_Object::ToSecond<IClient>(pClient)->Send(pBuffer, iLength);
  1338. }
  1339. HPSOCKET_API BOOL __HP_CALL HP_Client_SendPart(HP_Client pClient, const BYTE* pBuffer, int iLength, int iOffset)
  1340. {
  1341. return C_HP_Object::ToSecond<IClient>(pClient)->Send(pBuffer, iLength, iOffset);
  1342. }
  1343. HPSOCKET_API BOOL __HP_CALL HP_Client_SendPackets(HP_Client pClient, const WSABUF pBuffers[], int iCount)
  1344. {
  1345. return C_HP_Object::ToSecond<IClient>(pClient)->SendPackets(pBuffers, iCount);
  1346. }
  1347. HPSOCKET_API BOOL __HP_CALL HP_Client_PauseReceive(HP_Client pClient, BOOL bPause)
  1348. {
  1349. return C_HP_Object::ToSecond<IClient>(pClient)->PauseReceive(bPause);
  1350. }
  1351. /******************************************************************************/
  1352. /***************************** Client 属性访问方法 *****************************/
  1353. HPSOCKET_API void __HP_CALL HP_Client_SetExtra(HP_Client pClient, PVOID pExtra)
  1354. {
  1355. C_HP_Object::ToSecond<IClient>(pClient)->SetExtra(pExtra);
  1356. }
  1357. HPSOCKET_API PVOID __HP_CALL HP_Client_GetExtra(HP_Client pClient)
  1358. {
  1359. return C_HP_Object::ToSecond<IClient>(pClient)->GetExtra();
  1360. }
  1361. HPSOCKET_API BOOL __HP_CALL HP_Client_IsSecure(HP_Client pClient)
  1362. {
  1363. return C_HP_Object::ToSecond<IClient>(pClient)->IsSecure();
  1364. }
  1365. HPSOCKET_API BOOL __HP_CALL HP_Client_HasStarted(HP_Client pClient)
  1366. {
  1367. return C_HP_Object::ToSecond<IClient>(pClient)->HasStarted();
  1368. }
  1369. HPSOCKET_API En_HP_ServiceState __HP_CALL HP_Client_GetState(HP_Client pClient)
  1370. {
  1371. return C_HP_Object::ToSecond<IClient>(pClient)->GetState();
  1372. }
  1373. HPSOCKET_API En_HP_SocketError __HP_CALL HP_Client_GetLastError(HP_Client pClient)
  1374. {
  1375. return C_HP_Object::ToSecond<IClient>(pClient)->GetLastError();
  1376. }
  1377. HPSOCKET_API LPCTSTR __HP_CALL HP_Client_GetLastErrorDesc(HP_Client pClient)
  1378. {
  1379. return C_HP_Object::ToSecond<IClient>(pClient)->GetLastErrorDesc();
  1380. }
  1381. HPSOCKET_API HP_CONNID __HP_CALL HP_Client_GetConnectionID(HP_Client pClient)
  1382. {
  1383. return C_HP_Object::ToSecond<IClient>(pClient)->GetConnectionID();
  1384. }
  1385. HPSOCKET_API BOOL __HP_CALL HP_Client_GetLocalAddress(HP_Client pClient, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  1386. {
  1387. return C_HP_Object::ToSecond<IClient>(pClient)->GetLocalAddress(lpszAddress, *piAddressLen, *pusPort);
  1388. }
  1389. HPSOCKET_API BOOL __HP_CALL HP_Client_GetRemoteHost(HP_Client pClient, TCHAR lpszHost[], int* piHostLen, USHORT* pusPort)
  1390. {
  1391. return C_HP_Object::ToSecond<IClient>(pClient)->GetRemoteHost(lpszHost, *piHostLen, *pusPort);
  1392. }
  1393. HPSOCKET_API BOOL __HP_CALL HP_Client_GetPendingDataLength(HP_Client pClient, int* piPending)
  1394. {
  1395. return C_HP_Object::ToSecond<IClient>(pClient)->GetPendingDataLength(*piPending);
  1396. }
  1397. HPSOCKET_API BOOL __HP_CALL HP_Client_IsPauseReceive(HP_Client pClient, BOOL* pbPaused)
  1398. {
  1399. return C_HP_Object::ToSecond<IClient>(pClient)->IsPauseReceive(*pbPaused);
  1400. }
  1401. HPSOCKET_API void __HP_CALL HP_Client_SetFreeBufferPoolSize(HP_Client pClient, DWORD dwFreeBufferPoolSize)
  1402. {
  1403. C_HP_Object::ToSecond<IClient>(pClient)->SetFreeBufferPoolSize(dwFreeBufferPoolSize);
  1404. }
  1405. HPSOCKET_API void __HP_CALL HP_Client_SetFreeBufferPoolHold(HP_Client pClient, DWORD dwFreeBufferPoolHold)
  1406. {
  1407. C_HP_Object::ToSecond<IClient>(pClient)->SetFreeBufferPoolHold(dwFreeBufferPoolHold);
  1408. }
  1409. HPSOCKET_API DWORD __HP_CALL HP_Client_GetFreeBufferPoolSize(HP_Client pClient)
  1410. {
  1411. return C_HP_Object::ToSecond<IClient>(pClient)->GetFreeBufferPoolSize();
  1412. }
  1413. HPSOCKET_API DWORD __HP_CALL HP_Client_GetFreeBufferPoolHold(HP_Client pClient)
  1414. {
  1415. return C_HP_Object::ToSecond<IClient>(pClient)->GetFreeBufferPoolHold();
  1416. }
  1417. /**********************************************************************************/
  1418. /******************************* TCP Client 操作方法 *******************************/
  1419. HPSOCKET_API BOOL __HP_CALL HP_TcpClient_SendSmallFile(HP_Client pClient, LPCTSTR lpszFileName, const LPWSABUF pHead, const LPWSABUF pTail)
  1420. {
  1421. return C_HP_Object::ToSecond<ITcpClient>(pClient)->SendSmallFile(lpszFileName, pHead, pTail);
  1422. }
  1423. /**********************************************************************************/
  1424. /***************************** TCP Client 属性访问方法 *****************************/
  1425. HPSOCKET_API void __HP_CALL HP_TcpClient_SetSocketBufferSize(HP_TcpClient pClient, DWORD dwSocketBufferSize)
  1426. {
  1427. C_HP_Object::ToSecond<ITcpClient>(pClient)->SetSocketBufferSize(dwSocketBufferSize);
  1428. }
  1429. HPSOCKET_API void __HP_CALL HP_TcpClient_SetKeepAliveTime(HP_TcpClient pClient, DWORD dwKeepAliveTime)
  1430. {
  1431. C_HP_Object::ToSecond<ITcpClient>(pClient)->SetKeepAliveTime(dwKeepAliveTime);
  1432. }
  1433. HPSOCKET_API void __HP_CALL HP_TcpClient_SetKeepAliveInterval(HP_TcpClient pClient, DWORD dwKeepAliveInterval)
  1434. {
  1435. C_HP_Object::ToSecond<ITcpClient>(pClient)->SetKeepAliveInterval(dwKeepAliveInterval);
  1436. }
  1437. HPSOCKET_API DWORD __HP_CALL HP_TcpClient_GetSocketBufferSize(HP_TcpClient pClient)
  1438. {
  1439. return C_HP_Object::ToSecond<ITcpClient>(pClient)->GetSocketBufferSize();
  1440. }
  1441. HPSOCKET_API DWORD __HP_CALL HP_TcpClient_GetKeepAliveTime(HP_TcpClient pClient)
  1442. {
  1443. return C_HP_Object::ToSecond<ITcpClient>(pClient)->GetKeepAliveTime();
  1444. }
  1445. HPSOCKET_API DWORD __HP_CALL HP_TcpClient_GetKeepAliveInterval(HP_TcpClient pClient)
  1446. {
  1447. return C_HP_Object::ToSecond<ITcpClient>(pClient)->GetKeepAliveInterval();
  1448. }
  1449. /**********************************************************************************/
  1450. /***************************** UDP Client 属性访问方法 *****************************/
  1451. HPSOCKET_API void __HP_CALL HP_UdpClient_SetMaxDatagramSize(HP_UdpClient pClient, DWORD dwMaxDatagramSize)
  1452. {
  1453. C_HP_Object::ToSecond<IUdpClient>(pClient)->SetMaxDatagramSize(dwMaxDatagramSize);
  1454. }
  1455. HPSOCKET_API DWORD __HP_CALL HP_UdpClient_GetMaxDatagramSize(HP_UdpClient pClient)
  1456. {
  1457. return C_HP_Object::ToSecond<IUdpClient>(pClient)->GetMaxDatagramSize();
  1458. }
  1459. HPSOCKET_API void __HP_CALL HP_UdpClient_SetDetectAttempts(HP_UdpClient pClient, DWORD dwDetectAttempts)
  1460. {
  1461. C_HP_Object::ToSecond<IUdpClient>(pClient)->SetDetectAttempts(dwDetectAttempts);
  1462. }
  1463. HPSOCKET_API void __HP_CALL HP_UdpClient_SetDetectInterval(HP_UdpClient pClient, DWORD dwDetectInterval)
  1464. {
  1465. C_HP_Object::ToSecond<IUdpClient>(pClient)->SetDetectInterval(dwDetectInterval);
  1466. }
  1467. HPSOCKET_API DWORD __HP_CALL HP_UdpClient_GetDetectAttempts(HP_UdpClient pClient)
  1468. {
  1469. return C_HP_Object::ToSecond<IUdpClient>(pClient)->GetDetectAttempts();
  1470. }
  1471. HPSOCKET_API DWORD __HP_CALL HP_UdpClient_GetDetectInterval(HP_UdpClient pClient)
  1472. {
  1473. return C_HP_Object::ToSecond<IUdpClient>(pClient)->GetDetectInterval();
  1474. }
  1475. /**********************************************************************************/
  1476. /****************************** UDP Cast 属性访问方法 ******************************/
  1477. HPSOCKET_API void __HP_CALL HP_UdpCast_SetMaxDatagramSize(HP_UdpCast pCast, DWORD dwMaxDatagramSize)
  1478. {
  1479. C_HP_Object::ToSecond<IUdpCast>(pCast)->SetMaxDatagramSize(dwMaxDatagramSize);
  1480. }
  1481. HPSOCKET_API DWORD __HP_CALL HP_UdpCast_GetMaxDatagramSize(HP_UdpCast pCast)
  1482. {
  1483. return C_HP_Object::ToSecond<IUdpCast>(pCast)->GetMaxDatagramSize();
  1484. }
  1485. HPSOCKET_API BOOL __HP_CALL HP_UdpCast_GetRemoteAddress(HP_UdpCast pCast, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  1486. {
  1487. return C_HP_Object::ToSecond<IUdpCast>(pCast)->GetRemoteAddress(lpszAddress, *piAddressLen, *pusPort);
  1488. }
  1489. HPSOCKET_API void __HP_CALL HP_UdpCast_SetReuseAddress(HP_UdpCast pCast, BOOL bReuseAddress)
  1490. {
  1491. C_HP_Object::ToSecond<IUdpCast>(pCast)->SetReuseAddress(bReuseAddress);
  1492. }
  1493. HPSOCKET_API BOOL __HP_CALL HP_UdpCast_IsReuseAddress(HP_UdpCast pCast)
  1494. {
  1495. return C_HP_Object::ToSecond<IUdpCast>(pCast)->IsReuseAddress();
  1496. }
  1497. HPSOCKET_API void __HP_CALL HP_UdpCast_SetCastMode(HP_UdpCast pCast, En_HP_CastMode enCastMode)
  1498. {
  1499. C_HP_Object::ToSecond<IUdpCast>(pCast)->SetCastMode(enCastMode);
  1500. }
  1501. HPSOCKET_API En_HP_CastMode __HP_CALL HP_UdpCast_GetCastMode(HP_UdpCast pCast)
  1502. {
  1503. return C_HP_Object::ToSecond<IUdpCast>(pCast)->GetCastMode();
  1504. }
  1505. HPSOCKET_API void __HP_CALL HP_UdpCast_SetMultiCastTtl(HP_UdpCast pCast, int iMCTtl)
  1506. {
  1507. C_HP_Object::ToSecond<IUdpCast>(pCast)->SetMultiCastTtl(iMCTtl);
  1508. }
  1509. HPSOCKET_API int __HP_CALL HP_UdpCast_GetMultiCastTtl(HP_UdpCast pCast)
  1510. {
  1511. return C_HP_Object::ToSecond<IUdpCast>(pCast)->GetMultiCastTtl();
  1512. }
  1513. HPSOCKET_API void __HP_CALL HP_UdpCast_SetMultiCastLoop(HP_UdpCast pCast, BOOL bMCLoop)
  1514. {
  1515. C_HP_Object::ToSecond<IUdpCast>(pCast)->SetMultiCastLoop(bMCLoop);
  1516. }
  1517. HPSOCKET_API BOOL __HP_CALL HP_UdpCast_IsMultiCastLoop(HP_UdpCast pCast)
  1518. {
  1519. return C_HP_Object::ToSecond<IUdpCast>(pCast)->IsMultiCastLoop();
  1520. }
  1521. /***************************************************************************************/
  1522. /***************************** TCP Pull Server 组件操作方法 *****************************/
  1523. HPSOCKET_API En_HP_FetchResult __HP_CALL HP_TcpPullServer_Fetch(HP_TcpPullServer pServer, HP_CONNID dwConnID, BYTE* pData, int iLength)
  1524. {
  1525. return C_HP_Object::ToFirst<IPullSocket>(pServer)->Fetch(dwConnID, pData, iLength);
  1526. }
  1527. HPSOCKET_API En_HP_FetchResult __HP_CALL HP_TcpPullServer_Peek(HP_TcpPullServer pServer, HP_CONNID dwConnID, BYTE* pData, int iLength)
  1528. {
  1529. return C_HP_Object::ToFirst<IPullSocket>(pServer)->Peek(dwConnID, pData, iLength);
  1530. }
  1531. /***************************************************************************************/
  1532. /***************************** TCP Pull Server 属性访问方法 *****************************/
  1533. /***************************************************************************************/
  1534. /***************************** TCP Pull Agent 组件操作方法 *****************************/
  1535. HPSOCKET_API En_HP_FetchResult __HP_CALL HP_TcpPullAgent_Fetch(HP_TcpPullAgent pAgent, HP_CONNID dwConnID, BYTE* pData, int iLength)
  1536. {
  1537. return C_HP_Object::ToFirst<IPullSocket>(pAgent)->Fetch(dwConnID, pData, iLength);
  1538. }
  1539. HPSOCKET_API En_HP_FetchResult __HP_CALL HP_TcpPullAgent_Peek(HP_TcpPullAgent pAgent, HP_CONNID dwConnID, BYTE* pData, int iLength)
  1540. {
  1541. return C_HP_Object::ToFirst<IPullSocket>(pAgent)->Peek(dwConnID, pData, iLength);
  1542. }
  1543. /***************************************************************************************/
  1544. /***************************** TCP Pull Agent 属性访问方法 *****************************/
  1545. /***************************************************************************************/
  1546. /***************************** TCP Pull Client 组件操作方法 *****************************/
  1547. HPSOCKET_API En_HP_FetchResult __HP_CALL HP_TcpPullClient_Fetch(HP_TcpPullClient pClient, BYTE* pData, int iLength)
  1548. {
  1549. return C_HP_Object::ToFirst<IPullClient>(pClient)->Fetch(pData, iLength);
  1550. }
  1551. HPSOCKET_API En_HP_FetchResult __HP_CALL HP_TcpPullClient_Peek(HP_TcpPullClient pClient, BYTE* pData, int iLength)
  1552. {
  1553. return C_HP_Object::ToFirst<IPullClient>(pClient)->Peek(pData, iLength);
  1554. }
  1555. /***************************************************************************************/
  1556. /***************************** TCP Pull Client 属性访问方法 *****************************/
  1557. /***************************************************************************************/
  1558. /***************************** TCP Pack Server 组件操作方法 *****************************/
  1559. /***************************************************************************************/
  1560. /***************************** TCP Pack Server 属性访问方法 *****************************/
  1561. HPSOCKET_API void __HP_CALL HP_TcpPackServer_SetMaxPackSize(HP_TcpPackServer pServer, DWORD dwMaxPackSize)
  1562. {
  1563. C_HP_Object::ToFirst<IPackSocket>(pServer)->SetMaxPackSize(dwMaxPackSize);
  1564. }
  1565. HPSOCKET_API void __HP_CALL HP_TcpPackServer_SetPackHeaderFlag(HP_TcpPackServer pServer, USHORT usPackHeaderFlag)
  1566. {
  1567. C_HP_Object::ToFirst<IPackSocket>(pServer)->SetPackHeaderFlag(usPackHeaderFlag);
  1568. }
  1569. HPSOCKET_API DWORD __HP_CALL HP_TcpPackServer_GetMaxPackSize(HP_TcpPackServer pServer)
  1570. {
  1571. return C_HP_Object::ToFirst<IPackSocket>(pServer)->GetMaxPackSize();
  1572. }
  1573. HPSOCKET_API USHORT __HP_CALL HP_TcpPackServer_GetPackHeaderFlag(HP_TcpPackServer pServer)
  1574. {
  1575. return C_HP_Object::ToFirst<IPackSocket>(pServer)->GetPackHeaderFlag();
  1576. }
  1577. /***************************************************************************************/
  1578. /***************************** TCP Pack Agent 组件操作方法 *****************************/
  1579. /***************************************************************************************/
  1580. /***************************** TCP Pack Agent 属性访问方法 *****************************/
  1581. HPSOCKET_API void __HP_CALL HP_TcpPackAgent_SetMaxPackSize(HP_TcpPackAgent pAgent, DWORD dwMaxPackSize)
  1582. {
  1583. C_HP_Object::ToFirst<IPackSocket>(pAgent)->SetMaxPackSize(dwMaxPackSize);
  1584. }
  1585. HPSOCKET_API void __HP_CALL HP_TcpPackAgent_SetPackHeaderFlag(HP_TcpPackAgent pAgent, USHORT usPackHeaderFlag)
  1586. {
  1587. C_HP_Object::ToFirst<IPackSocket>(pAgent)->SetPackHeaderFlag(usPackHeaderFlag);
  1588. }
  1589. HPSOCKET_API DWORD __HP_CALL HP_TcpPackAgent_GetMaxPackSize(HP_TcpPackAgent pAgent)
  1590. {
  1591. return C_HP_Object::ToFirst<IPackSocket>(pAgent)->GetMaxPackSize();
  1592. }
  1593. HPSOCKET_API USHORT __HP_CALL HP_TcpPackAgent_GetPackHeaderFlag(HP_TcpPackAgent pAgent)
  1594. {
  1595. return C_HP_Object::ToFirst<IPackSocket>(pAgent)->GetPackHeaderFlag();
  1596. }
  1597. /***************************************************************************************/
  1598. /***************************** TCP Pack Client 组件操作方法 *****************************/
  1599. /***************************************************************************************/
  1600. /***************************** TCP Pack Client 属性访问方法 *****************************/
  1601. HPSOCKET_API void __HP_CALL HP_TcpPackClient_SetMaxPackSize(HP_TcpPackClient pClient, DWORD dwMaxPackSize)
  1602. {
  1603. C_HP_Object::ToFirst<IPackClient>(pClient)->SetMaxPackSize(dwMaxPackSize);
  1604. }
  1605. HPSOCKET_API void __HP_CALL HP_TcpPackClient_SetPackHeaderFlag(HP_TcpPackClient pClient, USHORT usPackHeaderFlag)
  1606. {
  1607. C_HP_Object::ToFirst<IPackClient>(pClient)->SetPackHeaderFlag(usPackHeaderFlag);
  1608. }
  1609. HPSOCKET_API DWORD __HP_CALL HP_TcpPackClient_GetMaxPackSize(HP_TcpPackClient pClient)
  1610. {
  1611. return C_HP_Object::ToFirst<IPackClient>(pClient)->GetMaxPackSize();
  1612. }
  1613. HPSOCKET_API USHORT __HP_CALL HP_TcpPackClient_GetPackHeaderFlag(HP_TcpPackClient pClient)
  1614. {
  1615. return C_HP_Object::ToFirst<IPackClient>(pClient)->GetPackHeaderFlag();
  1616. }
  1617. /*****************************************************************************************************************************************************/
  1618. /*************************************************************** Global Function Exports *************************************************************/
  1619. /*****************************************************************************************************************************************************/
  1620. HPSOCKET_API DWORD __HP_CALL HP_GetHPSocketVersion()
  1621. {
  1622. return ::GetHPSocketVersion();
  1623. }
  1624. HPSOCKET_API LPCTSTR __HP_CALL HP_GetSocketErrorDesc(En_HP_SocketError enCode)
  1625. {
  1626. return ::GetSocketErrorDesc(enCode);
  1627. }
  1628. HPSOCKET_API DWORD __HP_CALL SYS_GetLastError()
  1629. {
  1630. return ::GetLastError();
  1631. }
  1632. HPSOCKET_API int __HP_CALL SYS_WSAGetLastError()
  1633. {
  1634. return ::WSAGetLastError();
  1635. }
  1636. HPSOCKET_API int __HP_CALL SYS_SetSocketOption(SOCKET sock, int level, int name, LPVOID val, int len)
  1637. {
  1638. return ::SSO_SetSocketOption(sock, level, name, val, len);
  1639. }
  1640. HPSOCKET_API int __HP_CALL SYS_GetSocketOption(SOCKET sock, int level, int name, LPVOID val, int* len)
  1641. {
  1642. return ::SSO_GetSocketOption(sock, level, name, val, len);
  1643. }
  1644. HPSOCKET_API int __HP_CALL SYS_IoctlSocket(SOCKET sock, long cmd, u_long* arg)
  1645. {
  1646. return ::SSO_IoctlSocket(sock, cmd, arg);
  1647. }
  1648. HPSOCKET_API int __HP_CALL SYS_WSAIoctl(SOCKET sock, DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbInBuffer, LPVOID lpvOutBuffer, DWORD cbOutBuffer, LPDWORD lpcbBytesReturned)
  1649. {
  1650. return ::SSO_WSAIoctl(sock, dwIoControlCode, lpvInBuffer, cbInBuffer, lpvOutBuffer, cbOutBuffer, lpcbBytesReturned);
  1651. }
  1652. HPSOCKET_API int __HP_CALL SYS_SSO_NoDelay(SOCKET sock, BOOL bNoDelay)
  1653. {
  1654. return ::SSO_NoDelay(sock, bNoDelay);
  1655. }
  1656. HPSOCKET_API int __HP_CALL SYS_SSO_DontLinger(SOCKET sock, BOOL bDont)
  1657. {
  1658. return ::SSO_DontLinger(sock, bDont);
  1659. }
  1660. HPSOCKET_API int __HP_CALL SYS_SSO_Linger(SOCKET sock, USHORT l_onoff, USHORT l_linger)
  1661. {
  1662. return ::SSO_Linger(sock, l_onoff, l_linger);
  1663. }
  1664. HPSOCKET_API int __HP_CALL SYS_SSO_RecvBuffSize(SOCKET sock, int size)
  1665. {
  1666. return ::SSO_RecvBuffSize(sock, size);
  1667. }
  1668. HPSOCKET_API int __HP_CALL SYS_SSO_SendBuffSize(SOCKET sock, int size)
  1669. {
  1670. return ::SSO_SendBuffSize(sock, size);
  1671. }
  1672. HPSOCKET_API int __HP_CALL SYS_SSO_ReuseAddress(SOCKET sock, BOOL bReuse)
  1673. {
  1674. return ::SSO_ReuseAddress(sock, bReuse);
  1675. }
  1676. HPSOCKET_API BOOL __HP_CALL SYS_GetSocketLocalAddress(SOCKET socket, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  1677. {
  1678. return ::GetSocketLocalAddress(socket, lpszAddress, *piAddressLen, *pusPort);
  1679. }
  1680. HPSOCKET_API BOOL __HP_CALL SYS_GetSocketRemoteAddress(SOCKET socket, TCHAR lpszAddress[], int* piAddressLen, USHORT* pusPort)
  1681. {
  1682. return ::GetSocketRemoteAddress(socket, lpszAddress, *piAddressLen, *pusPort);
  1683. }
  1684. HPSOCKET_API BOOL __HP_CALL SYS_EnumHostIPAddresses(LPCTSTR lpszHost, En_HP_IPAddrType enType, HP_LPTIPAddr** lpppIPAddr, int* piIPAddrCount)
  1685. {
  1686. return ::EnumHostIPAddresses(lpszHost, enType, lpppIPAddr, *piIPAddrCount);
  1687. }
  1688. HPSOCKET_API BOOL __HP_CALL SYS_FreeHostIPAddresses(HP_LPTIPAddr* lppIPAddr)
  1689. {
  1690. return ::FreeHostIPAddresses(lppIPAddr);
  1691. }
  1692. HPSOCKET_API BOOL __HP_CALL SYS_IsIPAddress(LPCTSTR lpszAddress, En_HP_IPAddrType* penType)
  1693. {
  1694. return ::IsIPAddress(lpszAddress, penType);
  1695. }
  1696. HPSOCKET_API BOOL __HP_CALL SYS_GetIPAddress(LPCTSTR lpszHost, TCHAR lpszIP[], int* piIPLenth, En_HP_IPAddrType* penType)
  1697. {
  1698. return ::GetIPAddress(lpszHost, lpszIP, *piIPLenth, *penType);
  1699. }
  1700. HPSOCKET_API ULONGLONG __HP_CALL SYS_NToH64(ULONGLONG value)
  1701. {
  1702. return ::NToH64(value);
  1703. }
  1704. HPSOCKET_API ULONGLONG __HP_CALL SYS_HToN64(ULONGLONG value)
  1705. {
  1706. return ::HToN64(value);
  1707. }
  1708. HPSOCKET_API BOOL __HP_CALL SYS_CodePageToUnicode(int iCodePage, const char szSrc[], WCHAR szDest[], int* piDestLength)
  1709. {
  1710. return ::CodePageToUnicode(iCodePage, szSrc, szDest, *piDestLength);
  1711. }
  1712. HPSOCKET_API BOOL __HP_CALL SYS_UnicodeToCodePage(int iCodePage, const WCHAR szSrc[], char szDest[], int* piDestLength)
  1713. {
  1714. return ::UnicodeToCodePage(iCodePage, szSrc, szDest, *piDestLength);
  1715. }
  1716. HPSOCKET_API BOOL __HP_CALL SYS_GbkToUnicode(const char szSrc[], WCHAR szDest[], int* piDestLength)
  1717. {
  1718. return ::GbkToUnicode(szSrc, szDest, *piDestLength);
  1719. }
  1720. HPSOCKET_API BOOL __HP_CALL SYS_UnicodeToGbk(const WCHAR szSrc[], char szDest[], int* piDestLength)
  1721. {
  1722. return ::UnicodeToGbk(szSrc, szDest, *piDestLength);
  1723. }
  1724. HPSOCKET_API BOOL __HP_CALL SYS_Utf8ToUnicode(const char szSrc[], WCHAR szDest[], int* piDestLength)
  1725. {
  1726. return ::Utf8ToUnicode(szSrc, szDest, *piDestLength);
  1727. }
  1728. HPSOCKET_API BOOL __HP_CALL SYS_UnicodeToUtf8(const WCHAR szSrc[], char szDest[], int* piDestLength)
  1729. {
  1730. return ::UnicodeToUtf8(szSrc, szDest, *piDestLength);
  1731. }
  1732. HPSOCKET_API BOOL __HP_CALL SYS_GbkToUtf8(const char szSrc[], char szDest[], int* piDestLength)
  1733. {
  1734. return ::GbkToUtf8(szSrc, szDest, *piDestLength);
  1735. }
  1736. HPSOCKET_API BOOL __HP_CALL SYS_Utf8ToGbk(const char szSrc[], char szDest[], int* piDestLength)
  1737. {
  1738. return ::Utf8ToGbk(szSrc, szDest, *piDestLength);
  1739. }
  1740. HPSOCKET_API DWORD __HP_CALL SYS_GuessBase64EncodeBound(DWORD dwSrcLen)
  1741. {
  1742. return ::GuessBase64EncodeBound(dwSrcLen);
  1743. }
  1744. HPSOCKET_API DWORD __HP_CALL SYS_GuessBase64DecodeBound(const BYTE* lpszSrc, DWORD dwSrcLen)
  1745. {
  1746. return ::GuessBase64DecodeBound(lpszSrc, dwSrcLen);
  1747. }
  1748. HPSOCKET_API int __HP_CALL SYS_Base64Encode(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  1749. {
  1750. return ::Base64Encode(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  1751. }
  1752. HPSOCKET_API int __HP_CALL SYS_Base64Decode(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  1753. {
  1754. return ::Base64Decode(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  1755. }
  1756. HPSOCKET_API DWORD __HP_CALL SYS_GuessUrlEncodeBound(const BYTE* lpszSrc, DWORD dwSrcLen)
  1757. {
  1758. return ::GuessUrlEncodeBound(lpszSrc, dwSrcLen);
  1759. }
  1760. HPSOCKET_API DWORD __HP_CALL SYS_GuessUrlDecodeBound(const BYTE* lpszSrc, DWORD dwSrcLen)
  1761. {
  1762. return ::GuessUrlDecodeBound(lpszSrc, dwSrcLen);
  1763. }
  1764. HPSOCKET_API int __HP_CALL SYS_UrlEncode(BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  1765. {
  1766. return ::UrlEncode(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  1767. }
  1768. HPSOCKET_API int __HP_CALL SYS_UrlDecode(BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  1769. {
  1770. return ::UrlDecode(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  1771. }
  1772. /*****************************************************************************************************************************************************/
  1773. /******************************************************************** HTTP Exports *******************************************************************/
  1774. /*****************************************************************************************************************************************************/
  1775. #ifdef _HTTP_SUPPORT
  1776. typedef C_HP_ObjectT<CHttpServer, IHttpServerListener, sizeof(IComplexHttpResponder)> C_HP_HttpServer;
  1777. typedef C_HP_ObjectT<CHttpAgent, IHttpAgentListener, sizeof(IComplexHttpRequester)> C_HP_HttpAgent;
  1778. typedef C_HP_ObjectT<CHttpClient, IHttpClientListener, sizeof(IHttpRequester)> C_HP_HttpClient;
  1779. typedef C_HP_ObjectT<CHttpSyncClient, IHttpClientListener, sizeof(IHttpSyncRequester)> C_HP_HttpSyncClient;
  1780. /****************************************************/
  1781. /***************** HTTP 对象创建函数 *****************/
  1782. HPSOCKET_API HP_HttpServer __HP_CALL Create_HP_HttpServer(HP_HttpServerListener pListener)
  1783. {
  1784. return (HP_HttpServer)(new C_HP_HttpServer((IHttpServerListener*)pListener));
  1785. }
  1786. HPSOCKET_API HP_HttpAgent __HP_CALL Create_HP_HttpAgent(HP_HttpAgentListener pListener)
  1787. {
  1788. return (HP_HttpAgent)(new C_HP_HttpAgent((IHttpAgentListener*)pListener));
  1789. }
  1790. HPSOCKET_API HP_HttpClient __HP_CALL Create_HP_HttpClient(HP_HttpClientListener pListener)
  1791. {
  1792. return (HP_HttpClient)(new C_HP_HttpClient((IHttpClientListener*)pListener));
  1793. }
  1794. HPSOCKET_API HP_HttpSyncClient __HP_CALL Create_HP_HttpSyncClient(HP_HttpClientListener pListener)
  1795. {
  1796. return (HP_HttpSyncClient)(new C_HP_HttpSyncClient((IHttpClientListener*)pListener));
  1797. }
  1798. HPSOCKET_API void __HP_CALL Destroy_HP_HttpServer(HP_HttpServer pServer)
  1799. {
  1800. delete (C_HP_HttpServer*)pServer;
  1801. }
  1802. HPSOCKET_API void __HP_CALL Destroy_HP_HttpAgent(HP_HttpAgent pAgent)
  1803. {
  1804. delete (C_HP_HttpAgent*)pAgent;
  1805. }
  1806. HPSOCKET_API void __HP_CALL Destroy_HP_HttpClient(HP_HttpClient pClient)
  1807. {
  1808. delete (C_HP_HttpClient*)pClient;
  1809. }
  1810. HPSOCKET_API void __HP_CALL Destroy_HP_HttpSyncClient(HP_HttpSyncClient pClient)
  1811. {
  1812. delete (C_HP_HttpSyncClient*)pClient;
  1813. }
  1814. HPSOCKET_API HP_HttpServerListener __HP_CALL Create_HP_HttpServerListener()
  1815. {
  1816. return (HP_HttpServerListener)(new C_HP_HttpServerListener);
  1817. }
  1818. HPSOCKET_API HP_HttpAgentListener __HP_CALL Create_HP_HttpAgentListener()
  1819. {
  1820. return (HP_HttpAgentListener)(new C_HP_HttpAgentListener);
  1821. }
  1822. HPSOCKET_API HP_HttpClientListener __HP_CALL Create_HP_HttpClientListener()
  1823. {
  1824. return (HP_HttpClientListener)(new C_HP_HttpClientListener);
  1825. }
  1826. HPSOCKET_API void __HP_CALL Destroy_HP_HttpServerListener(HP_HttpServerListener pListener)
  1827. {
  1828. delete (C_HP_HttpServerListener*)pListener;
  1829. }
  1830. HPSOCKET_API void __HP_CALL Destroy_HP_HttpAgentListener(HP_HttpAgentListener pListener)
  1831. {
  1832. delete (C_HP_HttpAgentListener*)pListener;
  1833. }
  1834. HPSOCKET_API void __HP_CALL Destroy_HP_HttpClientListener(HP_HttpClientListener pListener)
  1835. {
  1836. delete (C_HP_HttpClientListener*)pListener;
  1837. }
  1838. /**********************************************************************************/
  1839. /*************************** HTTP Server 回调函数设置方法 **************************/
  1840. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnMessageBegin(HP_HttpServerListener pListener, HP_FN_HttpServer_OnMessageBegin fn)
  1841. {
  1842. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnMessageBegin = fn;
  1843. }
  1844. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnRequestLine(HP_HttpServerListener pListener, HP_FN_HttpServer_OnRequestLine fn)
  1845. {
  1846. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnRequestLine = fn;
  1847. }
  1848. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnHeader(HP_HttpServerListener pListener, HP_FN_HttpServer_OnHeader fn)
  1849. {
  1850. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnHeader = fn;
  1851. }
  1852. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnHeadersComplete(HP_HttpServerListener pListener, HP_FN_HttpServer_OnHeadersComplete fn)
  1853. {
  1854. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnHeadersComplete = fn;
  1855. }
  1856. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnBody(HP_HttpServerListener pListener, HP_FN_HttpServer_OnBody fn)
  1857. {
  1858. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnBody = fn;
  1859. }
  1860. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnChunkHeader(HP_HttpServerListener pListener, HP_FN_HttpServer_OnChunkHeader fn)
  1861. {
  1862. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnChunkHeader = fn;
  1863. }
  1864. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnChunkComplete(HP_HttpServerListener pListener, HP_FN_HttpServer_OnChunkComplete fn)
  1865. {
  1866. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnChunkComplete = fn;
  1867. }
  1868. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnMessageComplete(HP_HttpServerListener pListener, HP_FN_HttpServer_OnMessageComplete fn)
  1869. {
  1870. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnMessageComplete = fn;
  1871. }
  1872. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnUpgrade(HP_HttpServerListener pListener, HP_FN_HttpServer_OnUpgrade fn)
  1873. {
  1874. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnUpgrade = fn;
  1875. }
  1876. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnParseError(HP_HttpServerListener pListener, HP_FN_HttpServer_OnParseError fn)
  1877. {
  1878. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnParseError = fn;
  1879. }
  1880. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnWSMessageHeader(HP_HttpServerListener pListener, HP_FN_HttpServer_OnWSMessageHeader fn)
  1881. {
  1882. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnWSMessageHeader = fn;
  1883. }
  1884. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnWSMessageBody(HP_HttpServerListener pListener, HP_FN_HttpServer_OnWSMessageBody fn)
  1885. {
  1886. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnWSMessageBody = fn;
  1887. }
  1888. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnWSMessageComplete(HP_HttpServerListener pListener, HP_FN_HttpServer_OnWSMessageComplete fn)
  1889. {
  1890. ((C_HP_HttpServerListener*)pListener)->m_lsnHttp.m_fnOnWSMessageComplete = fn;
  1891. }
  1892. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnPrepareListen(HP_HttpServerListener pListener, HP_FN_HttpServer_OnPrepareListen fn)
  1893. {
  1894. ((C_HP_HttpServerListener*)pListener)->m_lsnServer.m_fnOnPrepareListen = fn;
  1895. }
  1896. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnAccept(HP_HttpServerListener pListener, HP_FN_HttpServer_OnAccept fn)
  1897. {
  1898. ((C_HP_HttpServerListener*)pListener)->m_lsnServer.m_fnOnAccept = fn;
  1899. }
  1900. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnHandShake(HP_HttpServerListener pListener, HP_FN_HttpServer_OnHandShake fn)
  1901. {
  1902. ((C_HP_HttpServerListener*)pListener)->m_lsnServer.m_fnOnHandShake = fn;
  1903. }
  1904. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnSend(HP_HttpServerListener pListener, HP_FN_HttpServer_OnSend fn)
  1905. {
  1906. ((C_HP_HttpServerListener*)pListener)->m_lsnServer.m_fnOnSend = fn;
  1907. }
  1908. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnReceive(HP_HttpServerListener pListener, HP_FN_HttpServer_OnReceive fn)
  1909. {
  1910. ((C_HP_HttpServerListener*)pListener)->m_lsnServer.m_fnOnReceive = fn;
  1911. }
  1912. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnClose(HP_HttpServerListener pListener, HP_FN_HttpServer_OnClose fn)
  1913. {
  1914. ((C_HP_HttpServerListener*)pListener)->m_lsnServer.m_fnOnClose = fn;
  1915. }
  1916. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpServer_OnShutdown(HP_HttpServerListener pListener, HP_FN_HttpServer_OnShutdown fn)
  1917. {
  1918. ((C_HP_HttpServerListener*)pListener)->m_lsnServer.m_fnOnShutdown = fn;
  1919. }
  1920. /**********************************************************************************/
  1921. /**************************** HTTP Agent 回调函数设置方法 **************************/
  1922. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnMessageBegin(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnMessageBegin fn)
  1923. {
  1924. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnMessageBegin = fn;
  1925. }
  1926. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnStatusLine(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnStatusLine fn)
  1927. {
  1928. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnStatusLine = fn;
  1929. }
  1930. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnHeader(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnHeader fn)
  1931. {
  1932. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnHeader = fn;
  1933. }
  1934. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnHeadersComplete(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnHeadersComplete fn)
  1935. {
  1936. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnHeadersComplete = fn;
  1937. }
  1938. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnBody(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnBody fn)
  1939. {
  1940. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnBody = fn;
  1941. }
  1942. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnChunkHeader(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnChunkHeader fn)
  1943. {
  1944. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnChunkHeader = fn;
  1945. }
  1946. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnChunkComplete(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnChunkComplete fn)
  1947. {
  1948. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnChunkComplete = fn;
  1949. }
  1950. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnMessageComplete(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnMessageComplete fn)
  1951. {
  1952. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnMessageComplete = fn;
  1953. }
  1954. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnUpgrade(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnUpgrade fn)
  1955. {
  1956. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnUpgrade = fn;
  1957. }
  1958. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnParseError(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnParseError fn)
  1959. {
  1960. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnParseError = fn;
  1961. }
  1962. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnWSMessageHeader(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnWSMessageHeader fn)
  1963. {
  1964. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnWSMessageHeader = fn;
  1965. }
  1966. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnWSMessageBody(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnWSMessageBody fn)
  1967. {
  1968. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnWSMessageBody = fn;
  1969. }
  1970. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnWSMessageComplete(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnWSMessageComplete fn)
  1971. {
  1972. ((C_HP_HttpAgentListener*)pListener)->m_lsnHttp.m_fnOnWSMessageComplete = fn;
  1973. }
  1974. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnPrepareConnect(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnPrepareConnect fn)
  1975. {
  1976. ((C_HP_HttpAgentListener*)pListener)->m_lsnAgent.m_fnOnPrepareConnect = fn;
  1977. }
  1978. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnConnect(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnConnect fn)
  1979. {
  1980. ((C_HP_HttpAgentListener*)pListener)->m_lsnAgent.m_fnOnConnect = fn;
  1981. }
  1982. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnHandShake(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnHandShake fn)
  1983. {
  1984. ((C_HP_HttpAgentListener*)pListener)->m_lsnAgent.m_fnOnHandShake = fn;
  1985. }
  1986. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnReceive(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnReceive fn)
  1987. {
  1988. ((C_HP_HttpAgentListener*)pListener)->m_lsnAgent.m_fnOnReceive = fn;
  1989. }
  1990. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnSend(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnSend fn)
  1991. {
  1992. ((C_HP_HttpAgentListener*)pListener)->m_lsnAgent.m_fnOnSend = fn;
  1993. }
  1994. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnClose(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnClose fn)
  1995. {
  1996. ((C_HP_HttpAgentListener*)pListener)->m_lsnAgent.m_fnOnClose = fn;
  1997. }
  1998. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpAgent_OnShutdown(HP_HttpAgentListener pListener, HP_FN_HttpAgent_OnShutdown fn)
  1999. {
  2000. ((C_HP_HttpAgentListener*)pListener)->m_lsnAgent.m_fnOnShutdown = fn;
  2001. }
  2002. /**********************************************************************************/
  2003. /*************************** HTTP Client 回调函数设置方法 **************************/
  2004. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnMessageBegin(HP_HttpClientListener pListener, HP_FN_HttpClient_OnMessageBegin fn)
  2005. {
  2006. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnMessageBegin = fn;
  2007. }
  2008. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnStatusLine(HP_HttpClientListener pListener, HP_FN_HttpClient_OnStatusLine fn)
  2009. {
  2010. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnStatusLine = fn;
  2011. }
  2012. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnHeader(HP_HttpClientListener pListener, HP_FN_HttpClient_OnHeader fn)
  2013. {
  2014. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnHeader = fn;
  2015. }
  2016. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnHeadersComplete(HP_HttpClientListener pListener, HP_FN_HttpClient_OnHeadersComplete fn)
  2017. {
  2018. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnHeadersComplete = fn;
  2019. }
  2020. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnBody(HP_HttpClientListener pListener, HP_FN_HttpClient_OnBody fn)
  2021. {
  2022. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnBody = fn;
  2023. }
  2024. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnChunkHeader(HP_HttpClientListener pListener, HP_FN_HttpClient_OnChunkHeader fn)
  2025. {
  2026. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnChunkHeader = fn;
  2027. }
  2028. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnChunkComplete(HP_HttpClientListener pListener, HP_FN_HttpClient_OnChunkComplete fn)
  2029. {
  2030. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnChunkComplete = fn;
  2031. }
  2032. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnMessageComplete(HP_HttpClientListener pListener, HP_FN_HttpClient_OnMessageComplete fn)
  2033. {
  2034. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnMessageComplete = fn;
  2035. }
  2036. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnUpgrade(HP_HttpClientListener pListener, HP_FN_HttpClient_OnUpgrade fn)
  2037. {
  2038. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnUpgrade = fn;
  2039. }
  2040. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnParseError(HP_HttpClientListener pListener, HP_FN_HttpClient_OnParseError fn)
  2041. {
  2042. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnParseError = fn;
  2043. }
  2044. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnWSMessageHeader(HP_HttpClientListener pListener, HP_FN_HttpClient_OnWSMessageHeader fn)
  2045. {
  2046. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnWSMessageHeader = fn;
  2047. }
  2048. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnWSMessageBody(HP_HttpClientListener pListener, HP_FN_HttpClient_OnWSMessageBody fn)
  2049. {
  2050. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnWSMessageBody = fn;
  2051. }
  2052. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnWSMessageComplete(HP_HttpClientListener pListener, HP_FN_HttpClient_OnWSMessageComplete fn)
  2053. {
  2054. ((C_HP_HttpClientListener*)pListener)->m_lsnHttp.m_fnOnWSMessageComplete = fn;
  2055. }
  2056. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnPrepareConnect(HP_HttpClientListener pListener, HP_FN_HttpClient_OnPrepareConnect fn)
  2057. {
  2058. ((C_HP_HttpClientListener*)pListener)->m_lsnClient.m_fnOnPrepareConnect = fn;
  2059. }
  2060. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnConnect(HP_HttpClientListener pListener, HP_FN_HttpClient_OnConnect fn)
  2061. {
  2062. ((C_HP_HttpClientListener*)pListener)->m_lsnClient.m_fnOnConnect = fn;
  2063. }
  2064. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnHandShake(HP_HttpClientListener pListener, HP_FN_HttpClient_OnHandShake fn)
  2065. {
  2066. ((C_HP_HttpClientListener*)pListener)->m_lsnClient.m_fnOnHandShake = fn;
  2067. }
  2068. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnReceive(HP_HttpClientListener pListener, HP_FN_HttpClient_OnReceive fn)
  2069. {
  2070. ((C_HP_HttpClientListener*)pListener)->m_lsnClient.m_fnOnReceive = fn;
  2071. }
  2072. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnSend(HP_HttpClientListener pListener, HP_FN_HttpClient_OnSend fn)
  2073. {
  2074. ((C_HP_HttpClientListener*)pListener)->m_lsnClient.m_fnOnSend = fn;
  2075. }
  2076. HPSOCKET_API void __HP_CALL HP_Set_FN_HttpClient_OnClose(HP_HttpClientListener pListener, HP_FN_HttpClient_OnClose fn)
  2077. {
  2078. ((C_HP_HttpClientListener*)pListener)->m_lsnClient.m_fnOnClose = fn;
  2079. }
  2080. /**************************************************************************/
  2081. /*************************** HTTP Server 操作方法 **************************/
  2082. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_SendResponse(HP_HttpServer pServer, HP_CONNID dwConnID, USHORT usStatusCode, LPCSTR lpszDesc, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pData, int iLength)
  2083. {
  2084. return C_HP_Object::ToFirst<IHttpServer>(pServer)->SendResponse(dwConnID, usStatusCode, lpszDesc, lpHeaders, iHeaderCount, pData, iLength);
  2085. }
  2086. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_SendLocalFile(HP_HttpServer pServer, HP_CONNID dwConnID, LPCSTR lpszFileName, USHORT usStatusCode, LPCSTR lpszDesc, const HP_THeader lpHeaders[], int iHeaderCount)
  2087. {
  2088. return C_HP_Object::ToFirst<IHttpServer>(pServer)->SendLocalFile(dwConnID, lpszFileName, usStatusCode, lpszDesc, lpHeaders, iHeaderCount);
  2089. }
  2090. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_SendWSMessage(HP_HttpServer pServer, HP_CONNID dwConnID, BOOL bFinal, BYTE iReserved, BYTE iOperationCode, const BYTE lpszMask[4], BYTE* pData, int iLength, ULONGLONG ullBodyLen)
  2091. {
  2092. return C_HP_Object::ToFirst<IHttpServer>(pServer)->SendWSMessage(dwConnID, bFinal, iReserved, iOperationCode, lpszMask, pData, iLength, ullBodyLen);
  2093. }
  2094. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_Release(HP_HttpServer pServer, HP_CONNID dwConnID)
  2095. {
  2096. return C_HP_Object::ToFirst<IHttpServer>(pServer)->Release(dwConnID);
  2097. }
  2098. /******************************************************************************/
  2099. /*************************** HTTP Server 属性访问方法 **************************/
  2100. HPSOCKET_API void __HP_CALL HP_HttpServer_SetReleaseDelay(HP_HttpServer pServer, DWORD dwReleaseDelay)
  2101. {
  2102. C_HP_Object::ToFirst<IHttpServer>(pServer)->SetReleaseDelay(dwReleaseDelay);
  2103. }
  2104. HPSOCKET_API DWORD __HP_CALL HP_HttpServer_GetReleaseDelay(HP_HttpServer pServer)
  2105. {
  2106. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetReleaseDelay();
  2107. }
  2108. HPSOCKET_API USHORT __HP_CALL HP_HttpServer_GetUrlFieldSet(HP_HttpServer pServer, HP_CONNID dwConnID)
  2109. {
  2110. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetUrlFieldSet(dwConnID);
  2111. }
  2112. HPSOCKET_API LPCSTR __HP_CALL HP_HttpServer_GetUrlField(HP_HttpServer pServer, HP_CONNID dwConnID, En_HP_HttpUrlField enField)
  2113. {
  2114. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetUrlField(dwConnID, enField);
  2115. }
  2116. HPSOCKET_API LPCSTR __HP_CALL HP_HttpServer_GetMethod(HP_HttpServer pServer, HP_CONNID dwConnID)
  2117. {
  2118. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetMethod(dwConnID);
  2119. }
  2120. HPSOCKET_API void __HP_CALL HP_HttpServer_SetLocalVersion(HP_HttpServer pServer, En_HP_HttpVersion usVersion)
  2121. {
  2122. C_HP_Object::ToFirst<IHttpServer>(pServer)->SetLocalVersion(usVersion);
  2123. }
  2124. HPSOCKET_API En_HP_HttpVersion __HP_CALL HP_HttpServer_GetLocalVersion(HP_HttpServer pServer)
  2125. {
  2126. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetLocalVersion();
  2127. }
  2128. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_IsUpgrade(HP_HttpServer pServer, HP_CONNID dwConnID)
  2129. {
  2130. return C_HP_Object::ToFirst<IHttpServer>(pServer)->IsUpgrade(dwConnID);
  2131. }
  2132. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_IsKeepAlive(HP_HttpServer pServer, HP_CONNID dwConnID)
  2133. {
  2134. return C_HP_Object::ToFirst<IHttpServer>(pServer)->IsKeepAlive(dwConnID);
  2135. }
  2136. HPSOCKET_API USHORT __HP_CALL HP_HttpServer_GetVersion(HP_HttpServer pServer, HP_CONNID dwConnID)
  2137. {
  2138. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetVersion(dwConnID);
  2139. }
  2140. HPSOCKET_API LPCSTR __HP_CALL HP_HttpServer_GetHost(HP_HttpServer pServer, HP_CONNID dwConnID)
  2141. {
  2142. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetHost(dwConnID);
  2143. }
  2144. HPSOCKET_API ULONGLONG __HP_CALL HP_HttpServer_GetContentLength(HP_HttpServer pServer, HP_CONNID dwConnID)
  2145. {
  2146. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetContentLength(dwConnID);
  2147. }
  2148. HPSOCKET_API LPCSTR __HP_CALL HP_HttpServer_GetContentType(HP_HttpServer pServer, HP_CONNID dwConnID)
  2149. {
  2150. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetContentType(dwConnID);
  2151. }
  2152. HPSOCKET_API LPCSTR __HP_CALL HP_HttpServer_GetContentEncoding(HP_HttpServer pServer, HP_CONNID dwConnID)
  2153. {
  2154. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetContentEncoding(dwConnID);
  2155. }
  2156. HPSOCKET_API LPCSTR __HP_CALL HP_HttpServer_GetTransferEncoding(HP_HttpServer pServer, HP_CONNID dwConnID)
  2157. {
  2158. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetTransferEncoding(dwConnID);
  2159. }
  2160. HPSOCKET_API En_HP_HttpUpgradeType __HP_CALL HP_HttpServer_GetUpgradeType(HP_HttpServer pServer, HP_CONNID dwConnID)
  2161. {
  2162. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetUpgradeType(dwConnID);
  2163. }
  2164. HPSOCKET_API USHORT __HP_CALL HP_HttpServer_GetParseErrorCode(HP_HttpServer pServer, HP_CONNID dwConnID, LPCSTR* lpszErrorDesc)
  2165. {
  2166. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetParseErrorCode(dwConnID, lpszErrorDesc);
  2167. }
  2168. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_GetHeader(HP_HttpServer pServer, HP_CONNID dwConnID, LPCSTR lpszName, LPCSTR* lpszValue)
  2169. {
  2170. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetHeader(dwConnID, lpszName, lpszValue);
  2171. }
  2172. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_GetHeaders(HP_HttpServer pServer, HP_CONNID dwConnID, LPCSTR lpszName, LPCSTR lpszValue[], DWORD* pdwCount)
  2173. {
  2174. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetHeaders(dwConnID, lpszName, lpszValue, *pdwCount);
  2175. }
  2176. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_GetAllHeaders(HP_HttpServer pServer, HP_CONNID dwConnID, HP_THeader lpHeaders[], DWORD* pdwCount)
  2177. {
  2178. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetAllHeaders(dwConnID, lpHeaders, *pdwCount);
  2179. }
  2180. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_GetAllHeaderNames(HP_HttpServer pServer, HP_CONNID dwConnID, LPCSTR lpszName[], DWORD* pdwCount)
  2181. {
  2182. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetAllHeaderNames(dwConnID, lpszName, *pdwCount);
  2183. }
  2184. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_GetCookie(HP_HttpServer pServer, HP_CONNID dwConnID, LPCSTR lpszName, LPCSTR* lpszValue)
  2185. {
  2186. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetCookie(dwConnID, lpszName, lpszValue);
  2187. }
  2188. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_GetAllCookies(HP_HttpServer pServer, HP_CONNID dwConnID, HP_TCookie lpCookies[], DWORD* pdwCount)
  2189. {
  2190. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetAllCookies(dwConnID, lpCookies, *pdwCount);
  2191. }
  2192. HPSOCKET_API BOOL __HP_CALL HP_HttpServer_GetWSMessageState(HP_HttpServer pServer, HP_CONNID dwConnID, BOOL* lpbFinal, BYTE* lpiReserved, BYTE* lpiOperationCode, LPCBYTE* lpszMask, ULONGLONG* lpullBodyLen, ULONGLONG* lpullBodyRemain)
  2193. {
  2194. return C_HP_Object::ToFirst<IHttpServer>(pServer)->GetWSMessageState(dwConnID, lpbFinal, lpiReserved, lpiOperationCode, lpszMask, lpullBodyLen, lpullBodyRemain);
  2195. }
  2196. /**************************************************************************/
  2197. /*************************** HTTP Agent 操作方法 ***************************/
  2198. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendRequest(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszMethod, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2199. {
  2200. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendRequest(dwConnID, lpszMethod, lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2201. }
  2202. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendLocalFile(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszFileName, LPCSTR lpszMethod, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2203. {
  2204. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendLocalFile(dwConnID, lpszFileName, lpszMethod, lpszPath, lpHeaders, iHeaderCount);
  2205. }
  2206. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendPost(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2207. {
  2208. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendPost(dwConnID, lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2209. }
  2210. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendPut(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2211. {
  2212. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendPut(dwConnID, lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2213. }
  2214. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendPatch(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2215. {
  2216. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendPatch(dwConnID, lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2217. }
  2218. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendGet(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2219. {
  2220. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendGet(dwConnID, lpszPath, lpHeaders, iHeaderCount);
  2221. }
  2222. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendDelete(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2223. {
  2224. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendDelete(dwConnID, lpszPath, lpHeaders, iHeaderCount);
  2225. }
  2226. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendHead(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2227. {
  2228. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendHead(dwConnID, lpszPath, lpHeaders, iHeaderCount);
  2229. }
  2230. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendTrace(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2231. {
  2232. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendTrace(dwConnID, lpszPath, lpHeaders, iHeaderCount);
  2233. }
  2234. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendOptions(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2235. {
  2236. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendOptions(dwConnID, lpszPath, lpHeaders, iHeaderCount);
  2237. }
  2238. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendConnect(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszHost, const HP_THeader lpHeaders[], int iHeaderCount)
  2239. {
  2240. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendConnect(dwConnID, lpszHost, lpHeaders, iHeaderCount);
  2241. }
  2242. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_SendWSMessage(HP_HttpAgent pAgent, HP_CONNID dwConnID, BOOL bFinal, BYTE iReserved, BYTE iOperationCode, const BYTE lpszMask[4], BYTE* pData, int iLength, ULONGLONG ullBodyLen)
  2243. {
  2244. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SendWSMessage(dwConnID, bFinal, iReserved, iOperationCode, lpszMask, pData, iLength, ullBodyLen);
  2245. }
  2246. /******************************************************************************/
  2247. /*************************** HTTP Agent 属性访问方法 ***************************/
  2248. HPSOCKET_API USHORT __HP_CALL HP_HttpAgent_GetStatusCode(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2249. {
  2250. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetStatusCode(dwConnID);
  2251. }
  2252. HPSOCKET_API void __HP_CALL HP_HttpAgent_SetLocalVersion(HP_HttpAgent pAgent, En_HP_HttpVersion usVersion)
  2253. {
  2254. C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SetLocalVersion(usVersion);
  2255. }
  2256. HPSOCKET_API En_HP_HttpVersion __HP_CALL HP_HttpAgent_GetLocalVersion(HP_HttpAgent pAgent)
  2257. {
  2258. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetLocalVersion();
  2259. }
  2260. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_IsUpgrade(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2261. {
  2262. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->IsUpgrade(dwConnID);
  2263. }
  2264. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_IsKeepAlive(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2265. {
  2266. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->IsKeepAlive(dwConnID);
  2267. }
  2268. HPSOCKET_API USHORT __HP_CALL HP_HttpAgent_GetVersion(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2269. {
  2270. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetVersion(dwConnID);
  2271. }
  2272. HPSOCKET_API ULONGLONG __HP_CALL HP_HttpAgent_GetContentLength(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2273. {
  2274. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetContentLength(dwConnID);
  2275. }
  2276. HPSOCKET_API LPCSTR __HP_CALL HP_HttpAgent_GetContentType(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2277. {
  2278. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetContentType(dwConnID);
  2279. }
  2280. HPSOCKET_API LPCSTR __HP_CALL HP_HttpAgent_GetContentEncoding(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2281. {
  2282. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetContentEncoding(dwConnID);
  2283. }
  2284. HPSOCKET_API LPCSTR __HP_CALL HP_HttpAgent_GetTransferEncoding(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2285. {
  2286. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetTransferEncoding(dwConnID);
  2287. }
  2288. HPSOCKET_API En_HP_HttpUpgradeType __HP_CALL HP_HttpAgent_GetUpgradeType(HP_HttpAgent pAgent, HP_CONNID dwConnID)
  2289. {
  2290. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetUpgradeType(dwConnID);
  2291. }
  2292. HPSOCKET_API USHORT __HP_CALL HP_HttpAgent_GetParseErrorCode(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR* lpszErrorDesc)
  2293. {
  2294. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetParseErrorCode(dwConnID, lpszErrorDesc);
  2295. }
  2296. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_GetHeader(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszName, LPCSTR* lpszValue)
  2297. {
  2298. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetHeader(dwConnID, lpszName, lpszValue);
  2299. }
  2300. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_GetHeaders(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszName, LPCSTR lpszValue[], DWORD* pdwCount)
  2301. {
  2302. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetHeaders(dwConnID, lpszName, lpszValue, *pdwCount);
  2303. }
  2304. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_GetAllHeaders(HP_HttpAgent pAgent, HP_CONNID dwConnID, HP_THeader lpHeaders[], DWORD* pdwCount)
  2305. {
  2306. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetAllHeaders(dwConnID, lpHeaders, *pdwCount);
  2307. }
  2308. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_GetAllHeaderNames(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszName[], DWORD* pdwCount)
  2309. {
  2310. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetAllHeaderNames(dwConnID, lpszName, *pdwCount);
  2311. }
  2312. HPSOCKET_API void __HP_CALL HP_HttpAgent_SetUseCookie(HP_HttpAgent pAgent, BOOL bUseCookie)
  2313. {
  2314. C_HP_Object::ToFirst<IHttpAgent>(pAgent)->SetUseCookie(bUseCookie);
  2315. }
  2316. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_IsUseCookie(HP_HttpAgent pAgent)
  2317. {
  2318. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->IsUseCookie();
  2319. }
  2320. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_GetCookie(HP_HttpAgent pAgent, HP_CONNID dwConnID, LPCSTR lpszName, LPCSTR* lpszValue)
  2321. {
  2322. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetCookie(dwConnID, lpszName, lpszValue);
  2323. }
  2324. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_GetAllCookies(HP_HttpAgent pAgent, HP_CONNID dwConnID, HP_TCookie lpCookies[], DWORD* pdwCount)
  2325. {
  2326. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetAllCookies(dwConnID, lpCookies, *pdwCount);
  2327. }
  2328. HPSOCKET_API BOOL __HP_CALL HP_HttpAgent_GetWSMessageState(HP_HttpAgent pAgent, HP_CONNID dwConnID, BOOL* lpbFinal, BYTE* lpiReserved, BYTE* lpiOperationCode, LPCBYTE* lpszMask, ULONGLONG* lpullBodyLen, ULONGLONG* lpullBodyRemain)
  2329. {
  2330. return C_HP_Object::ToFirst<IHttpAgent>(pAgent)->GetWSMessageState(dwConnID, lpbFinal, lpiReserved, lpiOperationCode, lpszMask, lpullBodyLen, lpullBodyRemain);
  2331. }
  2332. /**************************************************************************/
  2333. /*************************** HTTP Client 操作方法 **************************/
  2334. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendRequest(HP_HttpClient pClient, LPCSTR lpszMethod, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2335. {
  2336. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendRequest(lpszMethod, lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2337. }
  2338. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendLocalFile(HP_HttpClient pClient, LPCSTR lpszFileName, LPCSTR lpszMethod, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2339. {
  2340. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendLocalFile(lpszFileName, lpszMethod, lpszPath, lpHeaders, iHeaderCount);
  2341. }
  2342. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendPost(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2343. {
  2344. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendPost(lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2345. }
  2346. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendPut(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2347. {
  2348. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendPut(lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2349. }
  2350. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendPatch(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength)
  2351. {
  2352. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendPatch(lpszPath, lpHeaders, iHeaderCount, pBody, iLength);
  2353. }
  2354. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendGet(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2355. {
  2356. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendGet(lpszPath, lpHeaders, iHeaderCount);
  2357. }
  2358. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendDelete(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2359. {
  2360. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendDelete(lpszPath, lpHeaders, iHeaderCount);
  2361. }
  2362. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendHead(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2363. {
  2364. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendHead(lpszPath, lpHeaders, iHeaderCount);
  2365. }
  2366. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendTrace(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2367. {
  2368. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendTrace(lpszPath, lpHeaders, iHeaderCount);
  2369. }
  2370. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendOptions(HP_HttpClient pClient, LPCSTR lpszPath, const HP_THeader lpHeaders[], int iHeaderCount)
  2371. {
  2372. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendOptions(lpszPath, lpHeaders, iHeaderCount);
  2373. }
  2374. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendConnect(HP_HttpClient pClient, LPCSTR lpszHost, const HP_THeader lpHeaders[], int iHeaderCount)
  2375. {
  2376. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendConnect(lpszHost, lpHeaders, iHeaderCount);
  2377. }
  2378. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_SendWSMessage(HP_HttpClient pClient, BOOL bFinal, BYTE iReserved, BYTE iOperationCode, const BYTE lpszMask[4], BYTE* pData, int iLength, ULONGLONG ullBodyLen)
  2379. {
  2380. return C_HP_Object::ToFirst<IHttpClient>(pClient)->SendWSMessage(bFinal, iReserved, iOperationCode, lpszMask, pData, iLength, ullBodyLen);
  2381. }
  2382. /******************************************************************************/
  2383. /*************************** HTTP Client 属性访问方法 **************************/
  2384. HPSOCKET_API USHORT __HP_CALL HP_HttpClient_GetStatusCode(HP_HttpClient pClient)
  2385. {
  2386. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetStatusCode();
  2387. }
  2388. HPSOCKET_API void __HP_CALL HP_HttpClient_SetLocalVersion(HP_HttpClient pClient, En_HP_HttpVersion usVersion)
  2389. {
  2390. C_HP_Object::ToFirst<IHttpClient>(pClient)->SetLocalVersion(usVersion);
  2391. }
  2392. HPSOCKET_API En_HP_HttpVersion __HP_CALL HP_HttpClient_GetLocalVersion(HP_HttpClient pClient)
  2393. {
  2394. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetLocalVersion();
  2395. }
  2396. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_IsUpgrade(HP_HttpClient pClient)
  2397. {
  2398. return C_HP_Object::ToFirst<IHttpClient>(pClient)->IsUpgrade();
  2399. }
  2400. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_IsKeepAlive(HP_HttpClient pClient)
  2401. {
  2402. return C_HP_Object::ToFirst<IHttpClient>(pClient)->IsKeepAlive();
  2403. }
  2404. HPSOCKET_API USHORT __HP_CALL HP_HttpClient_GetVersion(HP_HttpClient pClient)
  2405. {
  2406. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetVersion();
  2407. }
  2408. HPSOCKET_API ULONGLONG __HP_CALL HP_HttpClient_GetContentLength(HP_HttpClient pClient)
  2409. {
  2410. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetContentLength();
  2411. }
  2412. HPSOCKET_API LPCSTR __HP_CALL HP_HttpClient_GetContentType(HP_HttpClient pClient)
  2413. {
  2414. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetContentType();
  2415. }
  2416. HPSOCKET_API LPCSTR __HP_CALL HP_HttpClient_GetContentEncoding(HP_HttpClient pClient)
  2417. {
  2418. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetContentEncoding();
  2419. }
  2420. HPSOCKET_API LPCSTR __HP_CALL HP_HttpClient_GetTransferEncoding(HP_HttpClient pClient)
  2421. {
  2422. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetTransferEncoding();
  2423. }
  2424. HPSOCKET_API En_HP_HttpUpgradeType __HP_CALL HP_HttpClient_GetUpgradeType(HP_HttpClient pClient)
  2425. {
  2426. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetUpgradeType();
  2427. }
  2428. HPSOCKET_API USHORT __HP_CALL HP_HttpClient_GetParseErrorCode(HP_HttpClient pClient, LPCSTR* lpszErrorDesc)
  2429. {
  2430. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetParseErrorCode(lpszErrorDesc);
  2431. }
  2432. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_GetHeader(HP_HttpClient pClient, LPCSTR lpszName, LPCSTR* lpszValue)
  2433. {
  2434. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetHeader(lpszName, lpszValue);
  2435. }
  2436. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_GetHeaders(HP_HttpClient pClient, LPCSTR lpszName, LPCSTR lpszValue[], DWORD* pdwCount)
  2437. {
  2438. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetHeaders(lpszName, lpszValue, *pdwCount);
  2439. }
  2440. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_GetAllHeaders(HP_HttpClient pClient, HP_THeader lpHeaders[], DWORD* pdwCount)
  2441. {
  2442. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetAllHeaders(lpHeaders, *pdwCount);
  2443. }
  2444. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_GetAllHeaderNames(HP_HttpClient pClient, LPCSTR lpszName[], DWORD* pdwCount)
  2445. {
  2446. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetAllHeaderNames(lpszName, *pdwCount);
  2447. }
  2448. HPSOCKET_API void __HP_CALL HP_HttpClient_SetUseCookie(HP_HttpClient pClient, BOOL bUseCookie)
  2449. {
  2450. C_HP_Object::ToFirst<IHttpClient>(pClient)->SetUseCookie(bUseCookie);
  2451. }
  2452. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_IsUseCookie(HP_HttpClient pClient)
  2453. {
  2454. return C_HP_Object::ToFirst<IHttpClient>(pClient)->IsUseCookie();
  2455. }
  2456. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_GetCookie(HP_HttpClient pClient, LPCSTR lpszName, LPCSTR* lpszValue)
  2457. {
  2458. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetCookie(lpszName, lpszValue);
  2459. }
  2460. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_GetAllCookies(HP_HttpClient pClient, HP_TCookie lpCookies[], DWORD* pdwCount)
  2461. {
  2462. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetAllCookies(lpCookies, *pdwCount);
  2463. }
  2464. HPSOCKET_API BOOL __HP_CALL HP_HttpClient_GetWSMessageState(HP_HttpClient pClient, BOOL* lpbFinal, BYTE* lpiReserved, BYTE* lpiOperationCode, LPCBYTE* lpszMask, ULONGLONG* lpullBodyLen, ULONGLONG* lpullBodyRemain)
  2465. {
  2466. return C_HP_Object::ToFirst<IHttpClient>(pClient)->GetWSMessageState(lpbFinal, lpiReserved, lpiOperationCode, lpszMask, lpullBodyLen, lpullBodyRemain);
  2467. }
  2468. /**************************************************************************/
  2469. /************************ HTTP Sync Client 操作方法 ************************/
  2470. HPSOCKET_API BOOL __HP_CALL HP_HttpSyncClient_OpenUrl(HP_HttpSyncClient pClient, LPCSTR lpszMethod, LPCSTR lpszUrl, const THeader lpHeaders[], int iHeaderCount, const BYTE* pBody, int iLength, BOOL bForceReconnect)
  2471. {
  2472. return C_HP_Object::ToFirst<IHttpSyncClient>(pClient)->OpenUrl(lpszMethod, lpszUrl, lpHeaders, iHeaderCount, pBody, iLength, bForceReconnect);
  2473. }
  2474. HPSOCKET_API BOOL __HP_CALL HP_HttpSyncClient_CleanupRequestResult(HP_HttpSyncClient pClient)
  2475. {
  2476. return C_HP_Object::ToFirst<IHttpSyncClient>(pClient)->CleanupRequestResult();
  2477. }
  2478. /**************************************************************************/
  2479. /********************** HTTP Sync Client 属性访问方法 **********************/
  2480. HPSOCKET_API void __HP_CALL HP_HttpSyncClient_SetConnectTimeout(HP_HttpSyncClient pClient, DWORD dwConnectTimeout)
  2481. {
  2482. C_HP_Object::ToFirst<IHttpSyncClient>(pClient)->SetConnectTimeout(dwConnectTimeout);
  2483. }
  2484. HPSOCKET_API void __HP_CALL HP_HttpSyncClient_SetRequestTimeout(HP_HttpSyncClient pClient, DWORD dwRequestTimeout)
  2485. {
  2486. C_HP_Object::ToFirst<IHttpSyncClient>(pClient)->SetRequestTimeout(dwRequestTimeout);
  2487. }
  2488. HPSOCKET_API DWORD __HP_CALL HP_HttpSyncClient_GetConnectTimeout(HP_HttpSyncClient pClient)
  2489. {
  2490. return C_HP_Object::ToFirst<IHttpSyncClient>(pClient)->GetConnectTimeout();
  2491. }
  2492. HPSOCKET_API DWORD __HP_CALL HP_HttpSyncClient_GetRequestTimeout(HP_HttpSyncClient pClient)
  2493. {
  2494. return C_HP_Object::ToFirst<IHttpSyncClient>(pClient)->GetRequestTimeout();
  2495. }
  2496. HPSOCKET_API BOOL __HP_CALL HP_HttpSyncClient_GetResponseBody(HP_HttpSyncClient pClient, LPCBYTE* lpszBody, int* piLength)
  2497. {
  2498. return C_HP_Object::ToFirst<IHttpSyncClient>(pClient)->GetResponseBody(lpszBody, piLength);
  2499. }
  2500. /**************************************************************************/
  2501. /*************************** HTTP Cookie 管理方法 **************************/
  2502. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_MGR_LoadFromFile(LPCSTR lpszFile, BOOL bKeepExists)
  2503. {
  2504. return g_CookieMgr.LoadFromFile(lpszFile, bKeepExists);
  2505. }
  2506. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_MGR_SaveToFile(LPCSTR lpszFile, BOOL bKeepExists)
  2507. {
  2508. return g_CookieMgr.SaveToFile(lpszFile, bKeepExists);
  2509. }
  2510. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_MGR_ClearCookies(LPCSTR lpszDomain, LPCSTR lpszPath)
  2511. {
  2512. return g_CookieMgr.ClearCookies(lpszDomain, lpszPath);
  2513. }
  2514. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_MGR_RemoveExpiredCookies(LPCSTR lpszDomain, LPCSTR lpszPath)
  2515. {
  2516. return g_CookieMgr.RemoveExpiredCookies(lpszDomain, lpszPath);
  2517. }
  2518. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_MGR_SetCookie(LPCSTR lpszName, LPCSTR lpszValue, LPCSTR lpszDomain, LPCSTR lpszPath, int iMaxAge, BOOL bHttpOnly, BOOL bSecure, int enSameSite, BOOL bOnlyUpdateValueIfExists)
  2519. {
  2520. return g_CookieMgr.SetCookie(lpszName, lpszValue, lpszDomain, lpszPath, iMaxAge, bHttpOnly, bSecure, (CCookie::EnSameSite)enSameSite, bOnlyUpdateValueIfExists);
  2521. }
  2522. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_MGR_DeleteCookie(LPCSTR lpszDomain, LPCSTR lpszPath, LPCSTR lpszName)
  2523. {
  2524. return g_CookieMgr.DeleteCookie(lpszDomain, lpszPath, lpszName);
  2525. }
  2526. HPSOCKET_API void __HP_CALL HP_HttpCookie_MGR_SetEnableThirdPartyCookie(BOOL bEnableThirdPartyCookie)
  2527. {
  2528. g_CookieMgr.SetEnableThirdPartyCookie(bEnableThirdPartyCookie);
  2529. }
  2530. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_MGR_IsEnableThirdPartyCookie()
  2531. {
  2532. return g_CookieMgr.IsEnableThirdPartyCookie();
  2533. }
  2534. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_HLP_ParseExpires(LPCSTR lpszExpires, __time64_t* ptmExpires)
  2535. {
  2536. return CCookie::ParseExpires(lpszExpires, *ptmExpires);
  2537. }
  2538. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_HLP_MakeExpiresStr(char lpszBuff[], int* piBuffLen, __time64_t tmExpires)
  2539. {
  2540. return CCookie::MakeExpiresStr(lpszBuff, *piBuffLen, tmExpires);
  2541. }
  2542. HPSOCKET_API BOOL __HP_CALL HP_HttpCookie_HLP_ToString(char lpszBuff[], int* piBuffLen, LPCSTR lpszName, LPCSTR lpszValue, LPCSTR lpszDomain, LPCSTR lpszPath, int iMaxAge, BOOL bHttpOnly, BOOL bSecure, int enSameSite)
  2543. {
  2544. return CCookie::ToString(lpszBuff, *piBuffLen, lpszName, lpszValue, lpszDomain, lpszPath, iMaxAge, bHttpOnly, bSecure, (CCookie::EnSameSite)enSameSite);
  2545. }
  2546. HPSOCKET_API __time64_t __HP_CALL HP_HttpCookie_HLP_CurrentUTCTime()
  2547. {
  2548. return CCookie::CurrentUTCTime();
  2549. }
  2550. HPSOCKET_API __time64_t __HP_CALL HP_HttpCookie_HLP_MaxAgeToExpires(int iMaxAge)
  2551. {
  2552. return CCookie::MaxAgeToExpires(iMaxAge);
  2553. }
  2554. HPSOCKET_API int __HP_CALL HP_HttpCookie_HLP_ExpiresToMaxAge(__time64_t tmExpires)
  2555. {
  2556. return CCookie::ExpiresToMaxAge(tmExpires);
  2557. }
  2558. /*****************************************************************************************************************************************************/
  2559. /************************************************************* HTTP Global Function Exports **********************************************************/
  2560. /*****************************************************************************************************************************************************/
  2561. HPSOCKET_API int __HP_CALL SYS_Compress(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  2562. {
  2563. return ::Compress(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  2564. }
  2565. HPSOCKET_API int __HP_CALL SYS_CompressEx(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen, int iLevel, int iMethod, int iWindowBits, int iMemLevel, int iStrategy)
  2566. {
  2567. return ::CompressEx(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen, iLevel, iMethod, iWindowBits, iMemLevel, iStrategy);
  2568. }
  2569. HPSOCKET_API int __HP_CALL SYS_Uncompress(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  2570. {
  2571. return ::Uncompress(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  2572. }
  2573. HPSOCKET_API int __HP_CALL SYS_UncompressEx(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen, int iWindowBits)
  2574. {
  2575. return ::UncompressEx(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen, iWindowBits);
  2576. }
  2577. HPSOCKET_API DWORD __HP_CALL SYS_GuessCompressBound(DWORD dwSrcLen, BOOL bGZip)
  2578. {
  2579. return ::GuessCompressBound(dwSrcLen, bGZip);
  2580. }
  2581. HPSOCKET_API int __HP_CALL SYS_GZipCompress(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  2582. {
  2583. return ::GZipCompress(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  2584. }
  2585. HPSOCKET_API int __HP_CALL SYS_GZipUncompress(const BYTE* lpszSrc, DWORD dwSrcLen, BYTE* lpszDest, DWORD* pdwDestLen)
  2586. {
  2587. return ::GZipUncompress(lpszSrc, dwSrcLen, lpszDest, *pdwDestLen);
  2588. }
  2589. HPSOCKET_API DWORD __HP_CALL SYS_GZipGuessUncompressBound(const BYTE* lpszSrc, DWORD dwSrcLen)
  2590. {
  2591. return ::GZipGuessUncompressBound(lpszSrc, dwSrcLen);
  2592. }
  2593. #endif