public void AddFromQueue(Queue <PacketClass> fromClient) { if (_socketList.Count != 0) { for (int n = 0; n < _socketList.Count; n++) { byte[] buffer; int recvLen; if (_socketList[n] != null && _socketList[n].ReceiveBuffer(out buffer, out recvLen)) { DefinedStructure.PacketInfo pInfo = new DefinedStructure.PacketInfo(); pInfo = (DefinedStructure.PacketInfo)ConvertPacket.ByteArrayToStructure(buffer, pInfo.GetType(), recvLen); PacketClass packet = new PacketClass(pInfo._id, pInfo._data, pInfo._totalSize, n, _socketList[n]._UUID); fromClient.Enqueue(packet); } } } }
public object Convert(Type type) { return(ConvertPacket.ByteArrayToStructure(_data, type, _dataSize)); }