hURL High-Level Interface

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

hURL High-Level Interface

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

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

Re: hURL High-Level Interface

Post 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?

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

Re: hURL High-Level Interface

Post 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

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

Re: hURL High-Level Interface

Post 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.

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

Re: hURL High-Level Interface

Post by PEB »

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

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

Re: hURL High-Level Interface

Post 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.

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

Re: hURL High-Level Interface

Post by PEB »

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

Post Reply