Page 1 of 1

hURL High-Level Interface

Posted: Mon Feb 24, 2020 3:18 am
by PEB
Could a couple more of Hollywood's network functions be made to work together with hURL?

I'm specifically thinking that it would be nice to have SSL and Adapter tags available for SendData() and ReceiveData().

Re: hURL High-Level Interface

Posted: Tue Feb 25, 2020 12:20 pm
by airsoftsoftwair
I think this is already possible. Both SendData() and ReceiveData() operate on a connection established by OpenConnection() and the latter supports both SSL and Adapter tags or am I missing something here?

Re: hURL High-Level Interface

Posted: Wed Feb 26, 2020 12:17 am
by PEB
Okay, the limitation that I thought was in SendData() and ReceiveData() seems, instead, to be connected with the OnReceiveData event.

The following code works with the standard OpenConnection(), but not when the SSL=True and Adapter="hurl" tags are used:

Code: Select all

@REQUIRE "hurl", {Link = True}

FTPServer$="192.168.1.102"

Function p_IncomingData()
	DebugPrint("Data Received")
EndFunction

InstallEventHandler({OnReceiveData=p_IncomingData})

OpenConnection(1, FTPServer$, 21)
;OpenConnection(1, FTPServer$, 21, {SSL=True, Adapter="hurl"})

Repeat
	WaitEvent
Forever

Re: hURL High-Level Interface

Posted: Fri Feb 28, 2020 10:20 pm
by airsoftsoftwair
Right, this is a limitation of the network adapter plugin API. I'll probably keep it that way because it shouldn't be that much of a problem to poll the data.

Re: hURL High-Level Interface

Posted: Fri Feb 28, 2020 11:01 pm
by PEB
What would be the best way to poll for data to be received?

Re: hURL High-Level Interface

Posted: Sat Feb 29, 2020 12:23 pm
by airsoftsoftwair
PEB wrote: Fri Feb 28, 2020 11:01 pm What would be the best way to poll for data to be received?
Depends on the actual script. If you're in a WaitEvent() based script, you could install an interval function that calls ReceiveData() several times per second. Otherwise just use a loop but include a throttle like VWait() to avoid hogging the CPU.

Re: hURL High-Level Interface

Posted: Sat Feb 29, 2020 9:52 pm
by PEB
I'll give it a try. Thanks for the suggestion.