請(qǐng)問,若一次收到多組的資料封包,在 dealInput 函數(shù)上如何處理?
例如: 在 dealInput 函數(shù)上預(yù)期收到27byte但實(shí)際已收到87Byte,是否是回傳0,然後在dealProcess 自行使用 Buffer 切割封包,若是這樣,dealInput 的函數(shù)就無意義了。
請(qǐng)問如何處理?
workerman沒有dealInput dealProcess 方法。協(xié)議解析里有input方法。如果input方法預(yù)期收到27byte,就返回27就行了,然后workeman會(huì)自動(dòng)分割,剩下的數(shù)據(jù)會(huì)在下一次input執(zhí)行時(shí)自動(dòng)傳入
dealInput
dealProcess
input