I noticed that you used sockread -gn, guess it's a typo because -g doesn't exists.you certainly want to use sockread -fn.
Maybe this typo isn't the problem, so what you can do is to make a while on $sockbr, to be sure to catch the whole data (there is an exemple in mirc help file, /help /sockread) and try what Bekar said
