Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

DSNER : Dead Simple Network Event Receiver

If you have a question or need help, this is the place to be.
Post Reply
miljbee
Experienced User
Posts: 146
Joined: Fri Mar 27, 2009 1:29 pm
Location: Orl├®ans, France

DSNER : Dead Simple Network Event Receiver

Post by miljbee »

__init__.py
(6.69 KiB) Downloaded 547 times
Hello,

jwka has recently posted some questions on how to send an event to eg via TCP.

The network event receiver works great, but need a little code when someone want to generate events from outside eg with it.
jwka wanted something really simple (like the broadcaster i Think). So I edited the network event receiver plugin to make it the most simple it could be.

So, there is no more security, and you can't send payload with this one.
It will accept anything it will receive.
Once it receives a "\n", it generates an event in eg with the string it has receives before the "\n" and closes the client socket.
That's it !

There is no DSNES (Dead simple network event sender), just use telnet to test :
type telnet 127.0.0.1 1234
enter text
hit enter
If DSNER is running on port 1234 you will get an event in eg. the suffix of the event is the text you entered in the telnet window.

Note that this plugin is based on the network event receiver and thus have the same bug :
Sometime, it will need 30s to start responding after eg has been starded.
By the way, I am now sure that the bug is in the asyncore loop, but I am not skilled enough in python to dig further.

Regards,
miljbee
TCP Events : A Better Network Event Sender/Receiver Plugin.
The Network Event Sender/Receiver in C#
Get events in EG from Google Calendar.
millercentral
Posts: 1
Joined: Mon Dec 07, 2015 11:10 pm

Re: DSNER : Dead Simple Network Event Receiver

Post by millercentral »

Hello, I know this is an old plug-in but it solves for what I'm looking to do, except for one thing... I know it has "Dead Simple" in the title, but I have no python experience...

As written, this plug in closes the socket as soon as it receives a line of text. I'd like to keep the connected socket open until a line of text matches a given string (eg "EXIT"), but still have it trigger events each time it finds a terminator and the input line does not equal the termination string.

Would someone be willing to help me modify the plugin to behave this way?

Thanks!
Post Reply