[Qt-creator] Regarding QByteArray

Kosta userqt at gmail.com
Sun May 24 21:43:09 CEST 2009


I'm looking right now at the packet send with Wireshark, and I see that 
there is one extra byte at the end.
I use
 d[0] = 0x01;
d[1] = 0x01;



 socket.bind(QHostAddress("172.16.101.100"), 161);

socket.writeDatagram(array, QHostAddress("172.16.101.100"), 161);



but it Wireshark I see ...01 01 90 . Any ideas why ?







----- Original Message ----- 
From: "Andre Poenitz" <andre.poenitz at mathematik.tu-chemnitz.de>
To: "Kosta" <userqt at gmail.com>
Cc: <andre.poenitz at mathematik.tu-chemnitz.de>
Sent: Sunday, May 24, 2009 7:22 PM
Subject: Re: [Qt-creator] Regarding QByteArray


> On Sun, May 24, 2009 at 07:17:46PM +0300, Kosta wrote:
>> Hm. And you say writeDatagram will not pass the \0 element to the wire.
>> Because I have debugged my code and saw the array representation of
>> ByteArray. I was not sure if it'll pass the added element also.
>
> "Sends the datagram at data of size /size/ to the..."
>
> So it will take as many bytes as you specify, data.size() would not
> include the \0.
>
> Andre'
>
>
> __________ Information from ESET NOD32 Antivirus, version of virus 
> signature database 4098 (20090522) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
> 


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com






More information about the Qt-creator-old mailing list