473,396 Members | 1,767 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Remote object with arguments?

Got a remoting question I was hoping someone could solve. I have an
object (UpdateFlifo) that
has two constructors, one empty, and one with arguments. I want to
expose this
object remotely, which I have done in the code below and everything
works fine.
I now want to expose this object using constructor arguements, but not
sure
how to do this, do you have any idea?
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(UpdateFlifo),
"UpdateFlifo",
WellKnownObjectMode.Singleton);
Mark.

Nov 8 '06 #1
4 3285
Hi Mark,

Server-activated objects require a default constructor.

"Server Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...Activation.asp

If you must use a constructor on the client then you'll need a
client-activated object. Singleton, however, is not client-activated.

"Client Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...asp?frame=true

It's also possible to use dynamic publication by marshaling the object
yourself. This way you can use any constructor that you'd like when you
create the object on the server. The object becomes registered as a
Singleton, for all intensive purposes. Dynamic publication and the
application configuration file are mutually exclusive methods for registering
a Singleton. Dynamic publication is another form of server-activation:

"RemotingServices.Marshal"
http://msdn2.microsoft.com/en-us/library/b6fy37a8.aspx

--
Dave Sexton

<mk*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Got a remoting question I was hoping someone could solve. I have an
object (UpdateFlifo) that
has two constructors, one empty, and one with arguments. I want to
expose this
object remotely, which I have done in the code below and everything
works fine.
I now want to expose this object using constructor arguements, but not
sure
how to do this, do you have any idea?
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(UpdateFlifo),
"UpdateFlifo",
WellKnownObjectMode.Singleton);
Mark.

Nov 8 '06 #2
Glad you explained it, no wonder I couldn't find any info on the Server
activated constructor. I might try your suggestion of Marshalling
myself. Thanks,

Mark.
Dave Sexton wrote:
Hi Mark,

Server-activated objects require a default constructor.

"Server Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...Activation.asp

If you must use a constructor on the client then you'll need a
client-activated object. Singleton, however, is not client-activated.

"Client Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...asp?frame=true

It's also possible to use dynamic publication by marshaling the object
yourself. This way you can use any constructor that you'd like when you
create the object on the server. The object becomes registered as a
Singleton, for all intensive purposes. Dynamic publication and the
application configuration file are mutually exclusive methods for registering
a Singleton. Dynamic publication is another form of server-activation:

"RemotingServices.Marshal"
http://msdn2.microsoft.com/en-us/library/b6fy37a8.aspx

--
Dave Sexton

<mk*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Got a remoting question I was hoping someone could solve. I have an
object (UpdateFlifo) that
has two constructors, one empty, and one with arguments. I want to
expose this
object remotely, which I have done in the code below and everything
works fine.
I now want to expose this object using constructor arguements, but not
sure
how to do this, do you have any idea?
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(UpdateFlifo),
"UpdateFlifo",
WellKnownObjectMode.Singleton);
Mark.
Nov 8 '06 #3
Dave,

Ok, I ran into a problem. I coded your recommendation for
marshalling myself using the RemotingServices.Marshal command, but
worked only for a while. Everything seemed to be working, but after 5
- 10 calls, I get a remotingerror unhandled exception in mscorlib.dll.

I suspect this is some sort of memory/threading issue, is this a risk
of using the Marshal command on my server?

Mark.
Dave Sexton wrote:
Hi Mark,

Server-activated objects require a default constructor.

"Server Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...Activation.asp

If you must use a constructor on the client then you'll need a
client-activated object. Singleton, however, is not client-activated.

"Client Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...asp?frame=true

It's also possible to use dynamic publication by marshaling the object
yourself. This way you can use any constructor that you'd like when you
create the object on the server. The object becomes registered as a
Singleton, for all intensive purposes. Dynamic publication and the
application configuration file are mutually exclusive methods for registering
a Singleton. Dynamic publication is another form of server-activation:

"RemotingServices.Marshal"
http://msdn2.microsoft.com/en-us/library/b6fy37a8.aspx

--
Dave Sexton

<mk*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Got a remoting question I was hoping someone could solve. I have an
object (UpdateFlifo) that
has two constructors, one empty, and one with arguments. I want to
expose this
object remotely, which I have done in the code below and everything
works fine.
I now want to expose this object using constructor arguements, but not
sure
how to do this, do you have any idea?
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(UpdateFlifo),
"UpdateFlifo",
WellKnownObjectMode.Singleton);
Mark.
Nov 9 '06 #4
Hi Mark,

I've used dynamic publication and haven't run into any indeterministic
problems like that. Behind the scenes I assume that the marshaled object
becomes a singleton, in the same way as when an object is registered through
configuration to be a singleton. There aren't any memory/threading concerns
that you should have (AFAIK) when calling Marshal that you shouldn't have
anyway when using configuration, so I'd be concerned more with your particular
implementation.

What is the exception?
(message and stack would be nice)

When is the exception thrown? (e.g., is it thrown at the client when calling
a method on the remote object?)

Is the failing remote method doing anything that is related to remoting
configuration?

--
Dave Sexton

"mkadlec" <mk*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Dave,

Ok, I ran into a problem. I coded your recommendation for
marshalling myself using the RemotingServices.Marshal command, but
worked only for a while. Everything seemed to be working, but after 5
- 10 calls, I get a remotingerror unhandled exception in mscorlib.dll.

I suspect this is some sort of memory/threading issue, is this a risk
of using the Marshal command on my server?

Mark.
Dave Sexton wrote:
>Hi Mark,

Server-activated objects require a default constructor.

"Server Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...Activation.asp

If you must use a constructor on the client then you'll need a
client-activated object. Singleton, however, is not client-activated.

"Client Activation" (.NET Remoting)
http://msdn.microsoft.com/library/de...asp?frame=true

It's also possible to use dynamic publication by marshaling the object
yourself. This way you can use any constructor that you'd like when you
create the object on the server. The object becomes registered as a
Singleton, for all intensive purposes. Dynamic publication and the
application configuration file are mutually exclusive methods for
registering
a Singleton. Dynamic publication is another form of server-activation:

"RemotingServices.Marshal"
http://msdn2.microsoft.com/en-us/library/b6fy37a8.aspx

--
Dave Sexton

<mk*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegr oups.com...
Got a remoting question I was hoping someone could solve. I have an
object (UpdateFlifo) that
has two constructors, one empty, and one with arguments. I want to
expose this
object remotely, which I have done in the code below and everything
works fine.
I now want to expose this object using constructor arguements, but not
sure
how to do this, do you have any idea?
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(UpdateFlifo),
"UpdateFlifo",
WellKnownObjectMode.Singleton);
Mark.

Nov 9 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Martin Waller | last post by:
Hello, I've been playing with the idea of just how to use an ASP page to provide a remote function call. In an ideal world this would be a web service but how can you do it if restricted to ASP...
0
by: Jerry Cain | last post by:
Everyone, I'm stumped by what I can only assume is trivial for someone with experience with C# and the Remoting functionality. I'd like to host the code for a particular class on a server: ...
1
by: Clinton Pierce | last post by:
I've got a class that I want to access remotely. The touble is, I can't figure out how to call the constructor of the class with arguments -- and the arguments are necessary to initialize the...
15
by: JJ | last post by:
A current requirement I am facing is the all business objects be stateless remote components hosted in IIS. I am partial to web services myself. However, it is insisted that IIS hosted remoting be...
5
by: Dan Pavel | last post by:
Hi, I am starting a new process (Notepad) on a remote machine but it is not visible. When I start it on my machine it is visible. What I am doing wrong ? private void run_notepad(string machina)...
4
by: cpptutor2000 | last post by:
Could some C guru help me please? I am using the following program to open a SSH connection to a remote host and eventually run a program on that remote host. #include <stdio.h> #include...
1
by: grace01 | last post by:
My php program has no response after migration. Here is the php code: <?php include_once("classes/ets.php"); include_once("classes/em_documents.php"); ...
0
by: aboutjav.com | last post by:
Hi, I need some help. I am getting this error after I complete the asp.net register control and click on the continue button. It crashed when it tries to get it calls this Profile property ...
5
by: Tony M | last post by:
vs 2005 - vb .net (desktop app) - XP Pro Trying to manipulate data form a desktop app. to a remote hosted website? Just trying to connect for now. Anyone know what I can change to make...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.