<div>How is the Master object you create from Python shared back with the C# code? (I&#39;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">&lt;<a href="mailto:jonvspython@gmail.com">jonvspython@gmail.com</a>&gt;</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&#39;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(&#39;MyModule&#39;)<br>clr.AddReference(&#39;System&#39;)<br>clr.AddReference(&#39;System.Net&#39;)<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 &quot;Protocol response received&quot;<br><br>def exception(i, f, e):<br>    print &quot;Protocol exception received&quot;<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&#39;ve already check that the events get processed. Function signatures seem to be ok too. Am I missing something? How can I trace what&#39;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>