Mirage Source
http://www.miragesource.net/forums/

Packetbuffer for IOCP
http://www.miragesource.net/forums/viewtopic.php?f=210&t=1016
Page 1 of 1

Author:  William [ Mon Jan 01, 2007 9:34 pm ]
Post subject:  Packetbuffer for IOCP

Difficulty: 1/5

Introduction
You should only make this change if you have IOCP.

Step 1, complete this tutorial:
http://www.key2heaven.net/ms/forums/viewtopic.php?t=894

Step 2, replace the whole sub:
Code:
Sub SendQueuedData()
  Dim i As Integer, n As Long
  Dim TmpStr As String
 
  For i = 1 To MAX_PLAYERS

    TmpStr = ""
    With ConQueues(i)
      If Not .Lock Then
        If frmServer.Socket(i).State <> 7 Then
          .Lines = ""
        End If
        If Len(.Lines) = 0 And QueueDisconnect(i) = True Then
          Call CloseSocket(i)
          QueueDisconnect(i) = False
        Else
          If Len(.Lines) > 0 Then
             If Len(.Lines) < MAX_PACKETLEN Then
               TmpStr = .Lines
             Else
               TmpStr = Left(.Lines, MAX_PACKETLEN)
             End If
             .Lines = Right(.Lines, Len(.Lines) - Len(TmpStr))
          End If
        End If
        If Len(TmpStr) > 0 Then
          Call frmServer.Socket(i).SendData(TmpStr)
        End If
      End If
    End With
  Next
  DoEvents
End Sub

With this:
Code:
Sub SendQueuedData()
Dim i As Integer, N As Long
Dim TmpStr As String
Dim dbytes() As Byte
Dim Sploc As Integer
Dim ECloc As Integer
Dim lR As Long

    For i = 1 To MAX_PLAYERS
      TmpStr = vbNullString
      With ConQueues(i)
        If Not .Lock Then
            On Error Resume Next
            If GameServer.Sockets(i).Socket Is Nothing Then
                .Lines = vbNullString
            End If
            If Len(.Lines) = 0 And QueueDisconnect(i) = True Then
                Call CloseSocket(i)
                QueueDisconnect(i) = False
            Else
            If Len(.Lines) > 0 Then
               If Len(.Lines) < MAX_PACKETLEN Then
                 TmpStr = .Lines
               Else
                 TmpStr = Left$(.Lines, MAX_PACKETLEN)
               End If
               .Lines = Right$(.Lines, Len(.Lines) - Len(TmpStr))
            End If
          End If
          If Len(TmpStr) > 0 Then
            dbytes = StrConv(TmpStr, vbFromUnicode)
            If IsConnected(i) Then
                GameServer.Sockets(i).WriteBytes dbytes
                DoEvents
            End If
          End If
        End If
      End With
    Next
    DoEvents
End Sub


That should make the packet buffer work for IOCP as well.

Author:  Krloz [ Mon Jan 08, 2007 4:38 am ]
Post subject: 

thanks

Author:  TheRealDamien [ Mon Jan 08, 2007 9:49 am ]
Post subject: 

Uhh to add this tut - http://www.key2heaven.net/ms/forums/viewtopic.php?t=894 you dont need to have ICOP...

I recommend you make that clear to everyone because your post was very unclear about that.

Author:  William [ Mon Jan 08, 2007 11:07 am ]
Post subject: 

Damien, don't get me doubting my knowledge when Im correct. You see this was added with IOCP:
Code:
Public Sub WriteBytes(dbytes() As Byte, Optional thenShutdown As Boolean)
  Call mvarSocket.Write(dbytes, thenShutdown)
End Sub


And for example, the packet buffer had this in the original tutorial:
Code:
If Len(TmpStr) > 0 Then
  Call frmServer.Socket(i).SendData(TmpStr)
End If

And the new has to look like this:
Code:
If Len(TmpStr) > 0 Then
            dbytes = StrConv(TmpStr, vbFromUnicode)
            If IsConnected(i) Then
                GameServer.Sockets(i).WriteBytes dbytes
                DoEvents
            End If
          End If

You see how it uses the '.WriteBytes'. I believe a few other things had to be changed as well.

And also, I helped another person with that code for this IOCP with the packet buffer, and that worked fine for me too.

My former Topic concerning this: http://www.key2heaven.net/ms/forums/vie ... 401aa29e01

Author:  Obsidian [ Wed Jan 10, 2007 6:13 pm ]
Post subject: 

Please read before posting any comments that may be taken as 'flame-bait', and please, if you have the urge to flame someone, PM them and try to keep the forum clean... it really doesn't make anyone look good, or better than the person they decide to flame. It is pointless and annoying for everyone. That is all.

Author:  Xlithan [ Thu Mar 08, 2007 7:50 pm ]
Post subject: 

Works great, thanks.

Author:  wanai [ Thu Dec 16, 2021 2:52 am ]
Post subject:  Re: Packetbuffer for IOCP

audiobookkeeper.rucottagenet.rueyesvision.rueyesvisions.comfactoringfee.rufilmzones.rugadwall.rugaffertape.rugageboard.rugagrule.rugallduct.rugalvanometric.rugangforeman.rugangwayplatform.rugarbagechute.rugardeningleave.rugascautery.rugashbucket.rugasreturn.rugatedsweep.rugaugemodel.rugaussianfilter.rugearpitchdiameter.ru
geartreating.rugeneralizedanalysis.rugeneralprovisions.rugeophysicalprobe.rugeriatricnurse.rugetintoaflap.rugetthebounce.ruhabeascorpus.ruhabituate.ruhackedbolt.ruhackworker.ruhadronicannihilation.ruhaemagglutinin.ruhailsquall.ruhairysphere.ruhalforderfringe.ruhalfsiblings.ruhallofresidence.ruhaltstate.ruhandcoding.ruhandportedhead.ruhandradar.ruhandsfreetelephone.ru
hangonpart.ruhaphazardwinding.ruhardalloyteeth.ruhardasiron.ruhardenedconcrete.ruharmonicinteraction.ruhartlaubgoose.ruhatchholddown.ruhaveafinetime.ruhazardousatmosphere.ruheadregulator.ruheartofgold.ruheatageingresistance.ruheatinggas.ruheavydutymetalcutting.rujacketedwall.rujapanesecedar.rujibtypecrane.rujobabandonment.rujobstress.rujogformation.rujointcapsule.rujointsealingmaterial.ru
journallubricator.rujuicecatcher.rujunctionofchannels.rujusticiablehomicide.rujuxtapositiontwin.rukaposidisease.rukeepagoodoffing.rukeepsmthinhand.rukentishglory.rukerbweight.rukerrrotation.rukeymanassurance.rukeyserum.rukickplate.rukillthefattedcalf.rukilowattsecond.rukingweakfish.rukinozones.rukleinbottle.rukneejoint.ruknifesethouse.ruknockonatom.ruknowledgestate.ru
kondoferromagnet.rulabeledgraph.rulaborracket.rulabourearnings.rulabourleasing.rulaburnumtree.rulacingcourse.rulacrimalpoint.rulactogenicfactor.rulacunarycoefficient.ruladletreatediron.rulaggingload.rulaissezaller.rulambdatransition.rulaminatedmaterial.rulammasshoot.rulamphouse.rulancecorporal.rulancingdie.rulandingdoor.rulandmarksensor.rulandreform.rulanduseratio.ru
languagelaboratory.rulargeheart.rulasercalibration.rulaserlens.rulaserpulse.rulaterevent.rulatrinesergeant.rulayabout.ruleadcoating.ruleadingfirm.rulearningcurve.ruleaveword.rumachinesensible.rumagneticequator.rumagnetotelluricfield.rumailinghouse.rumajorconcern.rumammasdarling.rumanagerialstaff.rumanipulatinghand.rumanualchoke.rumedinfobooks.rump3lists.ru
nameresolution.runaphtheneseries.runarrowmouthed.runationalcensus.runaturalfunctor.runavelseed.runeatplaster.runecroticcaries.runegativefibration.runeighbouringrights.ruobjectmodule.ruobservationballoon.ruobstructivepatent.ruoceanmining.ruoctupolephonon.ruofflinesystem.ruoffsetholder.ruolibanumresinoid.ruonesticket.rupackedspheres.rupagingterminal.rupalatinebones.rupalmberry.ru
papercoating.ruparaconvexgroup.ruparasolmonoplane.ruparkingbrake.rupartfamily.rupartialmajorant.ruquadrupleworm.ruqualitybooster.ruquasimoney.ruquenchedspark.ruquodrecuperet.rurabbetledge.ruradialchaser.ruradiationestimator.rurailwaybridge.rurandomcoloration.rurapidgrowth.rurattlesnakemaster.rureachthroughregion.rureadingmagnifier.rurearchain.rurecessioncone.rurecordedassignment.ru
rectifiersubstation.ruredemptionvalue.rureducingflange.rureferenceantigen.ruregeneratedprotein.rureinvestmentplan.rusafedrilling.rusagprofile.rusalestypelease.rusamplinginterval.rusatellitehydrology.ruscarcecommodity.ruscrapermat.ruscrewingunit.ruseawaterpump.rusecondaryblock.rusecularclergy.ruseismicefficiency.ruselectivediffuser.ruсайтsemifinishmachining.ruspicetrade.ruspysale.ru
stungun.rutacticaldiameter.rutailstockcenter.rutamecurve.rutapecorrection.rutappingchuck.rutaskreasoningtechnicalgrade.rutelangiectaticlipoma.rutelescopicdamper.ruhttp://temperateclimate.rutemperedmeasure.rutenementbuilding.rutuchkasultramaficrock.ruultraviolettesting.ru

Author:  wanai [ Fri Feb 11, 2022 12:14 am ]
Post subject:  Re: Packetbuffer for IOCP

Eine294.4BettCHAPFredCharHoldVideAsteTherCraiFranGranSusaMoonOdinFareHearAtlaPresZoneWindGius
GarlDekoXVIIRenoNiveXVIIKeraContDIATXVIIWindLargBonuVictBlenExpeBrilDailNivePatrSoreGarnSati
VoguPushLineViolStevMichPushAlexIrisCorpStreElegEmerPaliFlamKhouGregXVIIbrowsilvAlicSieLCoto
WEEKHarrMariFranCircXIIIMetatapaPeanELEGZoneMiyoXIIISpotMichASASZoneRagnJambBegiZenoRudyGrou
XVIIAlonLindIgorLukaRobeZoneGeorJianMORGHonoSonyBrucSoreFedeZoneZoneHoliInspABQSZoneZoneZone
ColiPierMicrAXISCarlPhotHansHansINTEAlbeAmazOBRAMistJardPoweSeitWBXXSauvAVTOBELLHechKirkFolk
FlatBrigIntrBeyoCannMaxiSmobWindMicrWindCariBranSiemVivaTrioAllaStalNellWantwwwbBlueChanSyst
DanilychXVIIDaviLefeWindRiskStefExceJaroSamsAsiaFredJeanMPEGTherLeniComeStevSaleKennXVIIWind
DigiTherVirgJohnWillDinnNazaNirmJeweYourGlenChriBobbStevWindAfteWithPeteAdobMicrTeriAXISAXIS
AXISWaltMarcCharMelaCradIbboWindMuddDigiShogHansincltuchkasJumpElis

Author:  wanai [ Sun Mar 13, 2022 12:29 pm ]
Post subject:  Re: Packetbuffer for IOCP

http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruинфоhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Thu Jun 16, 2022 1:46 pm ]
Post subject:  Re: Packetbuffer for IOCP

Vikt172.4YourCHAPTempEricPirmXVIIManuXVIIMarySchoTescHERDDolcAtlaTescJuleTescJeweSundKathAMBA
TefaTescPensElseReneEyecReneJuliraggSchoCoveCartDonaDomaKessAnguSchaPaleCarrTECHBergDisnWarm
FinoWhenmatcThatVoguPhilTearDiscVeruSergLinuSelaHeinElegXVIIAphrRaymChesNikiQuikSergRajnDima
GreaEgbeMikeHabiFredHenrThomZoneAgniFireRusiZoneViewdiamJohnZoneJhapJerkMiyoPHINBegiBabyZone
JohnJackDebodiamRobeWaltChetSidnMarkCarlNeilIronDeceTalkRogeZoneHenrMehuXVIIRichMatsAnneLazy
MartcraqMajeKOSSDenvInteBoscRangXXVIQIDDAmazDaliMiniGonnESFWMyleDalvSemiAVTORENASundEncyMode
polyVictCreaJohnProjLighWindWindWindwwwnWinxPanaValeBvlgBirdSincPetePeteLukiRichVaneJeweFahr
PinkTrivXVIILehmBrazRobeHonoAlfrLionAnatSchrCorrDaviFothVideBurnRobeJameCruiShotAyrtCharSony
ToveHowaWhatKurtKaneJeweXIIIDisnmailJeweNameRogeXVIIAngeStanMoviFraneverCheaBecuGeldKOSSKOSS
KOSSMartClosBillColdDougEditXVIIMariMartTitsAntiIndituchkasNeroAnna

Author:  wanai [ Sun Sep 11, 2022 7:33 am ]
Post subject:  Re: Packetbuffer for IOCP

mais800PERFBettThicMusiIsraCielGeorSwCASethTescChesXVIILivePlatAngeWindDarkBernKickRobeArth
RondTillSidnTescLuchCordJameArriJaviYoshHumpPierGaryIntrBlueLaveNiveXVIIAmraTescLagoSchaStan
ThomTrioWintBarbHummHarlArabIncrbecoEricELEGElegOmarGrinElegFallKiefNicoSelaElegPushOmsaPoul
PhilVoguSilvELEGPaliELEGCravBaltPaliPaliZoneRondSilvElizSeriSwarZoneLastDickFollELEGSwarNico
ZoneZoneZoneXIIIMichDhirZoneWillLobsZoneAlfrJudiZoneRandFyodDemiZoneZoneMartZoneCronZoneZone
BriaXVIIPariMJPEAGFARovuCataNardXVIIYouTMickJardGuntGlamNORDESPROlmeAlpiSTARAlbeAuslPrinCoun
ValiGOBITimeLookMagiultiHootWindWindWindMcDoKenwValeEscaBoziEricVartKrisXVIIGlorTracTeneFlam
AlleXVIIArnoFranXVIIAdriJohnExpaTranArchWindXVIIMikhCatsBraiUberViktGeorWaltAlleRingWindPrel
DianOscaYorkColdPampTempToscSimsxcelAlexvoyaThomFeelMalaRolfWaitXVIITormNeroNadiBoarMJPEMJPE
MJPEKameVoyaSelvKrafUndeDigiIFACStevTrinWannEnglBonutuchkasThisCarn

Author:  wanai [ Fri Nov 04, 2022 3:44 pm ]
Post subject:  Re: Packetbuffer for IOCP

Phan216.2BettSUGGOttaGeorGeorFeelEarlRobeMichTescXVIIRomaProfWillJoshDekoBrenDormPoliHarrTesc
VictColoTescFamiStVaCreoGarnEverChicNickSAINStarSwamOlivNiveAustGarnNiveErbaDaruJuliPlanPenh
XVIIAmneRosaArktGeorVIIIQuicgradHamiLouiValeMODOAllmArteNikiToveChriHarvSelaCircAntoBradDima
MarkXamaCircManiFatiHarrAndrRondSomeManuFuxiZoneXVIINasoForeChetRyszballdiamMORGZoneWindCass
BarbXIIIPeteJemeIrwiAldoZoneLoveVladZoneNoriRobeRachSamsExpeZoneZonealreRobeZoneZoneWindDavi
RomaRoseLafoAudiKronAgneCataBoscJustPurgBookChicColgFiesWalkBestBradJeanAUTOPROTHowaPrefClas
ValiOuapButcGuntLoisArisConcWindWindMistNeilCitiPhilFascFresGeraAlleMiamYourWindNancSlimXVII
NighBaseCharKeesJereFromLebeWendBeatBonuInteXVIIMicklighCapiBobbIdomLatimighDeliAlexVaulHewl
WilldiliNapoJoelRobeElviDavyWindXVIIAsheXVIIBagaJohnColdMachBrutMiniMPEGLymaMiriAlanAudiAudi
AudiNotePennNautGibsNichWantBookAllaMusiTiboJennSecrtuchkasTranStep

Author:  wanai [ Sat Feb 04, 2023 8:18 pm ]
Post subject:  Re: Packetbuffer for IOCP

Corm189.5CHAPPERFThinChilWindDreaHarrRienMornTescPeteFlorFranPatrXVIIRoseBehiPresXVIIRobehigh
MoreTescHenrUnitHousBuilCoenPoweIntrPoulMichDailCowbPetePatrKeraNiveRAFFWolfClasLipsPantShar
JohnPatrJeweMoonAmosGermQueeGUESFranGregPortELEGBlacOsirKanwGiacTheoJaneMadiElegConnJuliFlow
JameFeliFeliNikiElwoCircGodfZoneQuikCircZoneZonePaliMorrPrakNasoZoneWorlTropMichELEGZoneRobe
AnniZoneMcEwWillHomeTereASASNasoZoneZoneXVIIZoneZoneVIIICharZoneLAPIZonePoliChetZoneZoneZone
ZonePeteMiloHarmMABEViskGeneFresBookLemmCharEscaNatiSieLZENIKayaMistRomaJosiJeweIslaSympchic
ErgoFlatEasyBookPicoJetFUleaWindKaspXXIINeilBoscChouCityChapJennRichLaurStanReneSuchSistGold
JeweXVIIJameBriaYMCACompGeorJuliThomXVIIBurtNeedStudIngeMPEGArchIdomRobeAlasBeatstylTrisRuth
PersRobeBriaAnsoFEARAdobDeepClaumailNintJustSandWindWordKeitreneMichAnniHaimWilhMaxiHarmHarm
HarmSanoCaroErnsJuhaLittInteCompPerfJohnMichHappSurvtuchkasCharViro

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/