[icq-devel] Length Problem



Pierre shanka at worldonline.fr
Thu Jul 31 16:40:34 CEST 2003


Ok my source follow:
if (s.Connected)

{

s.Receive(single);

flapR.id=Convert.ToString(single[0],16);

s.Receive(single);

flapR.channelReceive=Convert.ToString(single[0],16);

s.Receive(duble);

flapR.sequenceReceive=Convert.ToString(duble[0],16)+Convert.ToString(duble[1],16);

s.Receive(duble);

if (duble[1]<10)

flapR.length=duble[0].ToString()+"0"+duble[1].ToString();

else 

flapR.length=duble[0].ToString()+duble[1].ToString();

if (flapR.channelReceive=="2")

dat = new Byte[Convert.ToInt16(flapR.length)];  <==THE PROBLEM IS HERE (sometimes the FlapR.length is in decimal format and sometimes in Hexa format)

else

dat = new Byte[Convert.ToInt16(flapR.length,16)];

s.Receive(dat);

i=0;

dataR.receive=null;

while(i<dat.Length)

{

if (Convert.ToString(dat[i],16).Length<2)

{

dataR.receive+="0";

dataR.receive+=Convert.ToString(dat[i],16);

}

else

dataR.receive+=Convert.ToString(dat[i],16);

i++;

}

Data received : 2a 02 e1 f3 01 13 00 13 00 06 ..........

The length in this sequence is 0113 . I'd must be receive 72 in hexa.

This problem happen only when I send CLI_ROSTER_CHECKOUT (13,06)



More information about the icq-devel mailing list