OpenConnection

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

OpenConnection

Post by boberski »

Hi,

can somebody write me an example how to use OpenConnection function?

TIA :)
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: OpenConnection

Post by CWO »

From the looks of it and from what's mentioned in the core-changes.txt at the time it was implemented, this looks like the same thing as an AUX connection except POL initiates the connection instead of the outside source.
boberski
Grandmaster Poster
Posts: 275
Joined: Tue Oct 15, 2013 12:00 pm

Re: OpenConnection

Post by boberski »

Yeah I know that....
OpenConnection( host, port, scriptdef )
Parameters:
host Target host
port Target port
scriptdef Name of the script to be started when the connection is established
Explanation
creates an outgoing TCP/IP connection
Return values
1 on success
I mean for example what is the structure of scriptdef script.
Nando
POL Developer
Posts: 284
Joined: Wed Sep 17, 2008 6:53 pm

Re: OpenConnection

Post by Nando »

I confess that the doc on OpenConnection is lacking, but it should work the same as an aux connection (as far as I can see it in the code). Try to make a script like this:

http://docs.polserver.com/pol099/script ... viceScript

Let me know if there are problems.
Post Reply