Click here to Skip to main content
15,920,956 members
Home / Discussions / C#
   

C#

 
GeneralRe: Catching the press of the Power Button Pin
Christian Graus2-Jun-05 14:10
protectorChristian Graus2-Jun-05 14:10 
GeneralRe: Catching the press of the Power Button Pin
Dmitriy Sinyagin2-Jun-05 14:24
Dmitriy Sinyagin2-Jun-05 14:24 
GeneralRe: Catching the press of the Power Button Pin
Christian Graus2-Jun-05 14:28
protectorChristian Graus2-Jun-05 14:28 
GeneralRe: Catching the press of the Power Button Pin
Dmitriy Sinyagin2-Jun-05 14:33
Dmitriy Sinyagin2-Jun-05 14:33 
GeneralTreeView /Spy++/ Handle Pin
Abhishek Karnik2-Jun-05 10:51
Abhishek Karnik2-Jun-05 10:51 
GeneralRe: TreeView /Spy++/ Handle Pin
mav.northwind2-Jun-05 22:13
mav.northwind2-Jun-05 22:13 
GeneralRe: TreeView /Spy++/ Handle Pin
Abhishek Karnik5-Jun-05 10:41
Abhishek Karnik5-Jun-05 10:41 
GeneralC# .NET Remoting problem Pin
Opa Knack2-Jun-05 9:38
Opa Knack2-Jun-05 9:38 
Hy, I Got a programming question on .NET remoting in C#:

Following scenario:

I've a server application and client applications with the graphical front end.
the server app marshales an object(a class for all the settings the client apps
need to know) via:

----------------------------------- server code snippet----------------------------------
BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();
serverProv.TypeFilterLevel = TypeFilterLevel.Full;

BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();

IDictionary props = new Hashtable();
props["port"] = 9999;

m_TcpChan = new TcpChannel(props, clientProv, serverProv);

ChannelServices.RegisterChannel(m_TcpChan);

sO = new ServerObject(mainClass.loadSets(), (IServer)this, mainClass.loadLogs());

sO.Clients = new ArrayList();

obj = RemotingServices.Marshal(sO, "settings");
----------------------------------------------------------------------------------------

and the client apps are "connecting" via:

------------------------------------client code snippet---------------------------------
TCP = new TcpChannel(0);
ChannelServices.RegisterChannel(TCP);
sO = (Interface.ServerObject) Activator.GetObject(typeof (Interface.ServerObject), "tcp://" + remoteIP + ":9999/settings");
----------------------------------------------------------------------------------------

know I can access sO.settings... to retrieve data I need on the client's side.

but there're also "remote methods" I cann call via:
sO.IServer.myServerRemoteMethod();

and: sO.ICLient.myClientremoteMethod(); (on the server side)

up to this point everything is working correctly!

my problem is that after somte time I can't call the remote methods anymore, the error is: "
System.Runtime.Remoting.RemotingException: Requested Service not found....

so I looked around some time to solve my problem and I read something about "Object Lifetime" and
"Leased Based Manager", I think my "remote methods" are destroyed after that standart 5min. of lifetime,
is that correct?! do I just have to return "null" in the overriden InitializeLifetimeService()
method? how to? that way?

public override Object InitializeLifetimeService()
{
ILease lease = (ILease)base.InitializeLifetimeService();
if (lease.CurrentState == LeaseState.Initial)
{
lease.InitialLeaseTime = TimeSpan.FromMinutes(1);
lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
}
return null;
}

I'm totally confused...

btw: I don't even know, if I have client activated or server sided object,
or whether I'm using singleTon or singleCall...

What would be the best solution for this Programm?

I'm looking foward for any help!

OpaKnack

GeneralRe: C# .NET Remoting problem Pin
mav.northwind2-Jun-05 20:29
mav.northwind2-Jun-05 20:29 
GeneralRe: C# .NET Remoting problem Pin
Opa Knack2-Jun-05 21:59
Opa Knack2-Jun-05 21:59 
GeneralRe: C# .NET Remoting problem Pin
mav.northwind2-Jun-05 22:07
mav.northwind2-Jun-05 22:07 
GeneralTreeView Pin
Gary Kirkham2-Jun-05 7:52
Gary Kirkham2-Jun-05 7:52 
GeneralRe: TreeView Pin
Christian Graus2-Jun-05 10:25
protectorChristian Graus2-Jun-05 10:25 
GeneralRe: TreeView Pin
Gary Kirkham2-Jun-05 12:33
Gary Kirkham2-Jun-05 12:33 
GeneralRe: TreeView Pin
Christian Graus2-Jun-05 12:42
protectorChristian Graus2-Jun-05 12:42 
GeneralRe: TreeView Pin
Luis Alonso Ramos2-Jun-05 13:00
Luis Alonso Ramos2-Jun-05 13:00 
GeneralRe: TreeView Pin
Christian Graus2-Jun-05 13:03
protectorChristian Graus2-Jun-05 13:03 
GeneralRe: TreeView Pin
Luis Alonso Ramos2-Jun-05 13:22
Luis Alonso Ramos2-Jun-05 13:22 
GeneralRe: TreeView Pin
Christian Graus2-Jun-05 13:25
protectorChristian Graus2-Jun-05 13:25 
QuestionWhat happens when the user leaves? Pin
Sled Dog2-Jun-05 7:14
Sled Dog2-Jun-05 7:14 
AnswerRe: What happens when the user leaves? Pin
Dave Kreskowiak2-Jun-05 9:31
mveDave Kreskowiak2-Jun-05 9:31 
GeneralRe: What happens when the user leaves? Pin
Anonymous2-Jun-05 12:31
Anonymous2-Jun-05 12:31 
GeneralRe: What happens when the user leaves? Pin
Dave Kreskowiak2-Jun-05 16:06
mveDave Kreskowiak2-Jun-05 16:06 
GeneralInteroperability when using Microsoft UIP Pin
Sridhar Subramanian2-Jun-05 6:53
Sridhar Subramanian2-Jun-05 6:53 
Generalmy URL is messed up Pin
Sled Dog2-Jun-05 6:31
Sled Dog2-Jun-05 6:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.