.Net client error connecting to AppServer: client operatingM

Posted by Rom Elwell on 12-Oct-2010 07:51

We are running an AppServer broker in Stateless mode and attempting to connect with a .Net client (utilizing assemblies built using ProxyGen).  The client throws the aforementioned exception and reviewing the broker log file, it can be seen that the connection request was nak'ed with the log message "Error: Unexpected CONNECT request in state-free mode...disconnecting client. (8091)".

When I stop\start the broker to change the mode to State-Freet, the .NET client still throws the same exception, and the AppServer log file reports the same error message:  "Error: Unexpected CONNECT request in state-free mode...disconnecting client. (8091)".

The question is this:  How can we explicitly set the state of the connection in the .Net client to ensure the client is attempting to connect to the broker in Stateless mode?  I suspect that I can set the value for the mode in the last parameter (appServerInfo) when instantiating the Connection object, however I cannot find any examples to prove this hypothesis. 

The .NET code is below for your review:

            try

            {

                Connection oConn = new Connection("AppServer://server.domain.com:9999/asABroker", "", "", "");

                MyClass oMyClass = new MyClass(oConn);              

            }

            catch (Progress.Open4GL.Exceptions.ConnectException ex)

            {

                MessageBox.Show(ex.ToString());

            }

Thank you in advance for any advice you can offer on this issue.

All Replies

Posted by Mike Ormerod on 12-Oct-2010 08:14

Hi Rom

You need to set the SessionModel attribute on your connection object, so :

Connection oConn = new Connection("AppServer://server.domain.com:9999/asABroker", "", "", "");

oConn.SessionModel = 1;

....

See Page 5-25 of the OpenEdge Development .NET Open Clients manual.

HTH

Mike

Posted by Rom Elwell on 12-Oct-2010 09:05

Thank you for the answer Mike!  Oddly, the copy of .NET Open Clients that I had was missing everything in Part 5 after page 5-6.  I have since downloaded a newer version of this document and can see there is much that was missed.

Posted by Mike Ormerod on 12-Oct-2010 09:19

No problem. Glad to help.

Mike

This thread is closed