Skip to Content
0
Former Member
Jun 22, 2005 at 08:50 AM

Problems with server connections (NCo 2.0, C#)

133 Views

Hello all.

I have written a SAP server (.NET Connector 2.0, C#, runs as service) which opens

3 server connections to SAP.

From the SAPServerHost class I have derieved my own class

and overwritten the callback function OnServerException.

When this function is triggered by disconnecting my server from the network

I call the Stop method of the host instance.

In a separat thread I call the hosts Start method in intervalls

(like every minute) to try to reconnect to SAP again.

After reconnecting my server to the network the host is restarted and opens

3 connections to SAP again.

Problem:

When I monitor my server connections in SAP (SMGW) I see 6 server connections

after reconnecting my server.

There are 3 corrupt connections that remain visible and which

I have to kill from within SMGW.

Question:

Are these 3 connections cleaned up by SAP after a while ?

Do I have to clean them up from within my server and if yes how do I do that ?

Here is my OnServerException method:

public override SAP.Connector.ActionOnServerException OnServerException(SAP.Connector.SAPServer server, System.Exception e)

{

if((this.ServerHostStatus != SAPServerStatus.Stopped) &&

(this.ServerHostStatus != SAPServerStatus.StopPending))

{

this.Stop();

}

return SAP.Connector.ActionOnServerException.AutoReconnect;

}

Thanks a lot for all responses in advance,

cheers

Fred