I want to write the picture to pic.bmp
But the socket doesn't seem to be able to get to the picture at all

Code:
 alias getpicture {
  %found = 0
  %socketwindow100 = @pic
  write -c pic.bmp
  /sockopen gpic vd.aligno.nl 80
}

on *:sockopen:gpic:{
  if $sockerr { echo -ac info * Error opening socket | return }
  var %s = sockwrite -n gpic
  %s GET /mypic.bmp HTTP/1.0
  %s Host: vd.aligno.nl $str($crlf,2)
}

on *:sockread:gpic:{
  if $sockerr { return }
  if !$sock(gpic).mark {
    var %a
    sockread %a
    if (%a != $null) /echo -s %a
    if %a == $null { sockmark gpic 1 }
  }
  else {
    sockread &a
    while $sockbr {
      bwrite pic.bmp -1 -1 &a
      sockread &a
      ;it doesnt even get here
      /echo -s - $bvar(&a).text
    }
  }
}
 


Why doesn't this work?

Last edited by FromTheSun; 08/07/05 12:26 PM.