<div>How is the Master object you create from Python shared back with the C# code? (I'm assuming that the event is being triggered from C#.) How did you check to see that the events were processed? Does the event-triggering code swallow exceptions?<br>
</div>
<div class="gmail_quote">On Fri, Apr 30, 2010 at 7:00 AM, jon vs. python <span dir="ltr"><<a href="mailto:jonvspython@gmail.com">jonvspython@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hi,<br>I've a couple of events in a C# assembly... <br><br>public class Master<br>{<br> ...<br>
public delegate void ResponseData(int id, byte function, byte[] data);<br> public event ResponseData OnResponseData;<br> public delegate void ExceptionData(int id, byte function, byte exception);<br>
public event ExceptionData OnException;<br><br><br>...that I subscribe from IronPython...<br><br>import clr<br>clr.AddReferenceToFile('MyModule')<br>clr.AddReference('System')<br>clr.AddReference('System.Net')<br>
...<br>from MyModule import Master<br>from System import Array<br>from System import Byte<br><br>def response(i, f, data):<br> print "Protocol response received"<br><br>def exception(i, f, e):<br> print "Protocol exception received"<br>
<br>class myMaster(object):<br> def __init__(self, ip, port):<br> self.mst = Master()<br> self.mst.OnResponseData += response<br> self.mst.OnException += exception<br> ...<br><br>...but never get called back. I've already check that the events get processed. Function signatures seem to be ok too. Am I missing something? How can I trace what's going on?<br>
Thanks, Jon.<br>
<div style="DISPLAY: inline"></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>