473,407 Members | 2,676 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,407 software developers and data experts.

Client Activated Remote Object

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:

namespace Space
{
public interface IShip
{
void launch();
void land();
}
}

namespace Space
{
public class Ship : IShip, MarshalByRefObj
{
Ship(string shipname) {...}
public void launch() {}
public void land() {}
}
}

Notice I'm being clear to present a one-argument constructor. I'm being a
purist and deciding that the construction of a Ship object should absolutely
require that the shipname be specified. Stated more clearly, I don't want
to include a zero-arg constructor just to make the remoting business simpler
(unless absolutely necessary).

I configure a server app to listen to port 5001 using TCP. I'm currently
using a config file, and would prefer to if at all possible.

I'm stumped as to how to instantiate a remote instance from a separate
client. I've gone through all the sample code, and none of them seem to
offer clear advice on how to effectively client-construct a Ship object
using Activator.GetObject (which seems to be what I'd want if the Ship were
server-activated) or even Activator.CreateInstance (which looks to me to be
the one I'm interested in). I see all nine overloaded version of
CreateInstance, and I even recognize those that allow you to pass in
arguments and whatnot, but I've no clear picture as to how to construct a
Ship using code on the server (via tcp, 5001).

Any good references? I've scrubbed MSDN and the examples are so simple that
they don't treat what I assume are the nuances of remoting.

Thanks for your help,
Jerry
je***@cs.stanford.edu
Nov 15 '05 #1
0 2312

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

Similar topics

3
by: Deepal | last post by:
Hi; I'm doing an example program from a book regarding .NET Remoting. Both the Client and Server are C# Console Applications. Server Code is using System; using System.Runtime.Remoting;...
6
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program...
2
by: JJ | last post by:
I want to create a client activated object using TcpChannel. The only way I could get it to work, though, is to provide the client with the remoted object's implementation. I'd rather not do this. ...
0
by: HankD | last post by:
Hello, from my scanning the groups all I have to do to use SSL with a remote object hosted in IIS is to change the http to https in the client.config (after you install SSL on the remoting server)....
4
by: Sharon | last post by:
Hi, I'm using the remoting, and I have a remoting object that has a public event that other processes should register to it. But when the client process is registering to the remote event, it...
2
by: Macca | last post by:
My app has an asynchronous socket server. It will have 20 clients connected to the server. Each client sends data every 500 millisecondsThe Connections once established will not be closed unless...
3
by: dcaveney | last post by:
Is there any way to replace the "src" attribute of an <imgelement with the name of a file on the client (obtained by a <input type="file"...element, for example) in such a way that the page then...
0
by: Piotrekk | last post by:
Hi I have a problem with my client activated objects. The service has very short lease time. Client calls function add(2,3) which saves total sum of 6. Then client performs Thread.Sleep(6) which...
0
by: Piotrekk | last post by:
Hi I have a problem with my client activated objects. The service has very short lease time. Client calls function GetProdct(2,3) which saves total product of 6. Then client performs...
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.