Hi,

Your caracters are sorted in the wrong order because of your DOEVENT... What I think is that the event is trigged a couple times and some of them are processed in the doevent inside the first event.

Try it without the doevent...
What is the scope of "D", global probably.
Also I can see you are using arrays of bytes...the best way to use getdata is with a string datatype.

The general idea is that the getdata only contains something like this :

winsock sub
dim sTemp as string

getdata sTemp
d = d & sTemp
end sub

AND you in a timer or something like this process the "d" variable

E-mail me if you want more info on this I think I got it pretty clear in my mind.

P.S. I've used Winsocks a lot and I'am convinced it should be spelled Winsuck as well as it's creator Microsucks :-)