hURL High-Level Interface

Discuss about plugins that don't have a dedicated forum
Post Reply
PEB
Posts: 280
Joined: Sun Feb 21, 2010 1:28 am

hURL High-Level Interface

Post by PEB » Mon Feb 24, 2020 3:18 am

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().

User avatar
airsoftsoftwair
Posts: 3355
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: hURL High-Level Interface

Post by airsoftsoftwair » Tue Feb 25, 2020 12:20 pm

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?

PEB
Posts: 280
Joined: Sun Feb 21, 2010 1:28 am

Re: hURL High-Level Interface

Post by PEB » Wed Feb 26, 2020 12:17 am

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

User avatar
airsoftsoftwair
Posts: 3355
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: hURL High-Level Interface

Post by airsoftsoftwair » Fri Feb 28, 2020 10:20 pm

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.

PEB
Posts: 280
Joined: Sun Feb 21, 2010 1:28 am

Re: hURL High-Level Interface

Post by PEB » Fri Feb 28, 2020 11:01 pm

What would be the best way to poll for data to be received?

User avatar
airsoftsoftwair
Posts: 3355
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: hURL High-Level Interface

Post by airsoftsoftwair » Sat Feb 29, 2020 12:23 pm

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.

PEB
Posts: 280
Joined: Sun Feb 21, 2010 1:28 am

Re: hURL High-Level Interface

Post by PEB » Sat Feb 29, 2020 9:52 pm

I'll give it a try. Thanks for the suggestion.

Post Reply