Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to restart a RfcServer after broken connection? (NCo 3.0.2)


I implemented a RfcServer which works fine so far. But if the connection breaks down due to network problems it stays in a unusable state and it seems the NCo does not reconnect automatically. What I do now is to stop the server if its state is Broken or Invalid:

if (server.Monitor.State == RfcServerState.Broken || server.Monitor.State == RfcServerState.Invalid) {

It is then restarted automatically after a few seconds:

if (server.Monitor.State == RfcServerState.Stopped) {

This does work, the server changes its state to Stopped and a little later to Starting. But then, before it ever reaches "Running" an exception is thrown, kills the whole application and generates these entrys in the Application eventlog:

.NET Runtime version 2.0.50727.3603 - Schwerwiegender Fehler im Ausf├╝hrungsmodul (000006427F44AE16) (80131506). (English translation "Fatal Execution Engine Error")

Faulting application myApp.exe, version 1.0.4164.17769, stamp 4ddf6643, faulting module mscorwks.dll, version 2.0.50727.3603, stamp 4a7cb0b3, debug? 0, fault address 0x00000000002c65c8.

The application is running as service (x64) for .net 3.5 SP1 on Windows 2003 R2 SP2. Any ideas? How to renew the registration with the SAP system?

Not what you were looking for? View more on this topic or Ask a question