<div dir="ltr">Yep, that did it. Спасибо!<br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 10:38 PM, Serge Aleynikov <span dir="ltr"><<a href="mailto:saleyn@gmail.com">saleyn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I took a quick look at your code and see that you are doing this on every button click which is wrong:<br>
<br>
OtpSelf self = new OtpSelf("client@localhost", "abc123");<br>
OtpPeer server = new OtpPeer("server@localhost");<br>
OtpConnection connection = server.connect(self);<br>
<br>
Move that to form initialization function, and try again. I guess what's going on is that OtpAbstractNode doesn't implement proper destruction and freeing resources (the socket connection), and as a result on every button click you are trying to set up more than one connection with the Erlang server node, which is not allowed, so the server drops the second and following connection attempts.<br>
<br>
Serge<br>
<br>
<br>
Matt Williamson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="Wj3C7c">
I'm trying out a simple <a href="http://OTP.NET" target="_blank">OTP.NET</a> test and it works great for the first call,<br>
but any subsequent calls result in the following exception:<br>
System.IO.IOException was unhandled<br>
Message="Peer replied with status 'alive' instead of 'ok'"<br>
Source="Otp"<br>
StackTrace:<br>
at Otp.AbstractConnection.recvStatus() in C:\Documents and<br>
Settings\Administrator\Desktop\jungerl\lib\<a href="http://otp.net" target="_blank">otp.net</a>\Otp\AbstractConnection.cs:line<br>
1455<br>
at Otp.AbstractConnection.doConnect(Int32 port) in C:\Documents and<br>
Settings\Administrator\Desktop\jungerl\lib\<a href="http://otp.net" target="_blank">otp.net</a>\Otp\AbstractConnection.cs:line<br>
1018<br>
at Otp.AbstractConnection..ctor(OtpLocalNode self, OtpPeer other) in<br>
C:\Documents and<br>
Settings\Administrator\Desktop\jungerl\lib\<a href="http://otp.net" target="_blank">otp.net</a>\Otp\AbstractConnection.cs:line<br>
226<br>
at Otp.OtpConnection..ctor(OtpSelf self, OtpPeer other) in<br>
C:\Documents and<br>
Settings\Administrator\Desktop\jungerl\lib\<a href="http://otp.net" target="_blank">otp.net</a>\Otp\OtpConnection.cs:line<br>
84<br>
at Otp.OtpPeer.connect(OtpSelf self) in C:\Documents and<br>
Settings\Administrator\Desktop\jungerl\lib\<a href="http://otp.net" target="_blank">otp.net</a>\Otp\OtpPeer.cs:line 67<br>
at ErlTestClient.Form1.button1_Click(Object sender, EventArgs e) in<br>
C:\Documents and Settings\Administrator\My<br>
Documents\Projects\ErlTestClient\ErlTestClient\Form1.cs:line 25<br>
at System.Windows.Forms.Control.OnClick(EventArgs e)<br>
at System.Windows.Forms.Button.OnClick(EventArgs e)<br>
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)<br>
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons<br>
button, Int32 clicks)<br>
at System.Windows.Forms.Control.WndProc(Message& m)<br>
at System.Windows.Forms.ButtonBase.WndProc(Message& m)<br>
at System.Windows.Forms.Button.WndProc(Message& m)<br>
at<br>
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)<br>
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&<br>
m)<br>
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,<br>
Int32 msg, IntPtr wparam, IntPtr lparam)<br>
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&<br>
msg)<br>
at<br>
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32<br>
dwComponentID, Int32 reason, Int32 pvLoopData)<br>
at<br>
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32<br>
reason, ApplicationContext context)<br>
at<br>
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,<br>
ApplicationContext context)<br>
at System.Windows.Forms.Application.Run(Form mainForm)<br>
at ErlTestClient.Program.Main() in C:\Documents and<br>
Settings\Administrator\My<br>
Documents\Projects\ErlTestClient\ErlTestClient\Program.cs:line 17<br>
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[]<br>
args)<br>
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence<br>
assemblySecurity, String[] args)<br>
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br>
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)<br>
at System.Threading.ExecutionContext.Run(ExecutionContext<br>
executionContext, ContextCallback callback, Object state)<br>
at System.Threading.ThreadHelper.ThreadStart()<br>
<br>
<br>
You can view my source at <a href="http://paste.lisp.org/display/67861" target="_blank">http://paste.lisp.org/display/67861</a> and<br>
<a href="http://paste.lisp.org/display/67862" target="_blank">http://paste.lisp.org/display/67862</a><br>
<br>
Erlang is v5.6.3 on windows and I'm running VS2005.<br>
<br>
Please help :)<br>
<br>
<br>
<br></div></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote>
<br>
</blockquote></div><br></div>