LibURL Error Previous request not completed

Jim Ault JimAultWins at yahoo.com
Wed Aug 2 14:01:33 EDT 2006


On 8/2/06 8:50 AM, "Mark Schonewille" <m.schonewille at economy-x-talk.com>
wrote:

> Hi Jim,
>Why do you mention UDP? I'm just establishing regular
> FTP connections.

Good question.  UDP is not the same as FTP.  It sends small packets (8000 K
or so limit) from app-to-app, computer-to-computer IF each app knows about
the other and can deal with the packet.

Let say you compile 2 apps, uploadKirk & downloadSpock.

They are both running on the same machine.  UDP can be used to talk between
them so that one is the main operator and sends a list of files to download
to the companion app.  Perhaps there may be an advantage to this since each
is its own app and won't be blocking the other.

(Untested.. .off the top of my head.  If I get time later tonight I can do
some testing for you, but likely you will not want me to bother.. Let me
know, otherwise I will drop it.)

Ports used are 4567 & 4568 on the same cpu (always IP 127.0.0.1)

---------uploadKirk  app -------------------------------
global gSpockIsBusy
on openstack
  accept datagram from socket 4568  with message "gotMsgFromSpock"
  put "" into gSpockBusy
end openstack

on sendInstuctionsToSpock
   if gSpockIsBusy is not empty then
      send "sendInstuctionsToSpock" to me in 1 second
   else
      put myNewList into fileListToDnld
      open datagram socket "127.0.0.1:4567"
      write "msg to Spock - download"&cr&  \
            fileListToDnld to socket "127.0.0.1:4567"
      close socket "127.0.0.1:4567"
      put "wait" into gSpockIsBusy
   end if
end sendInstuctionsToSpock

on gotMsgFromSpock hostt, msgg, sockett
   if msgg contains "done with download" then
      put "" into gSpockIsBusy
   end if
end gotMsgFromSpock

---------downloadSpock  app ----------------------
on openstack
   accept datagram from socket 4567 with message "gotMsgFromKirk"
end openstack

on gotMsgFromKirk hostt, msgg, sockett
   if msgg contains " download" then
      put line 2 to -1 of msgg into fileListToGet
     doFTP2ThisHardDrive(fileListToGet) --blocking, but not for Kirk
     confirmDnldDone
   end if
end gotMsgFromKirk

on confirmDnldDone
   open datagram socket "127.0.0.1:4568"
   write "msg to Kirk - done with download" to socket "127.0.0.1:4568"
   close socket "127.0.0.1:4568"
end confirmDnldDone

-------Sulu to all hands:  Transmitter Room now closed  -------------

Jim Ault
Las Vegas





More information about the use-livecode mailing list