Remoting Error




Hello All,
I am working on a remoting project and i dont know why but the object
created on server side and client side are totally diffrent from each
other.
Even their hash codes are diffrent, which means that i am getting 2
totally diff obj instead of sharing 1 obj between client/server.
Please Help :-SS

Also, can the server application call methods of the shared Object??

The procedure on server side is as follows:-
class NetworkManager
{
public RemDeskBridge rdb;
public NetworkManager()
{

TcpChannel tc = new TcpChannel(9000);
ChannelServices.RegisterChannel(tc,false);
RemotingConfiguration.RegisterWellKnownServiceType(typeof
(RemDeskBridge),

"RemDeskBridge.rem",WellKnownObjectMode.Singleton);
rdb = new RemDeskBridge();

}
}
---------------------------------
The procedure on client side is :-
public partial class Form1 : Form
{
RemDeskBridge rdb;
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

TcpChannel tc = new TcpChannel();
ChannelServices.RegisterChannel(tc,false);

rdb = (RemDeskBridge)
Activator.GetObject(typeof(RemDeskBridge),

"tcp://localhost:9000/RemDeskBridge.rem");
}
----------------------------------------------

Here's the shared class RemDeskBridge between them

public class RemDeskBridge : MarshalByRefObject
{
bool isConnected, isAuthenticated;
string user, pass;
Image img;
//Setter Methods
public void setUP(string u, string p)
{
user = u;
pass = p;
}
public void setConnected(bool val)
{
isConnected = val;
}
public void setAuthenticated(bool val)
{
isAuthenticated = val;
}
public void setImage(Image i)
{
img = i;
}
//Gettter Methods
public bool authenticate(string u, string p)
{
if ((u == user) && (p == pass))
return (true);
else
return (false);
}
public bool canConnect()
{
return (!(isConnected));
}
public Image getImage()
{
return (img);
}
}

.



Relevant Pages

  • Re: Socket problems
    ... I'm trying to write a 20 client chat server which is not ... >> public void listenFromClients() ... > // create a new communicator task and pass it the socket ...
    (comp.lang.java.programmer)
  • Re: Multiplayer gaming
    ... Server code: ... public void RunServer() { ... Client client = new Client); ... We have a very simple game with several spaceships which try to kill ...
    (microsoft.public.dotnet.csharp.general)
  • Re: GSSException: Failure unspecified at GSS-API level (Mechanismbytes long)
    ... This problem only occurs when the server is being run using java 1.5 ... and I connect from a client using java 1.4 or vice versa. ... I created a special SecurityContext class which both the ... public void setServiceName{ ...
    (comp.protocols.kerberos)
  • Deserialization exception when using MarshalByRef object with events
    ... I'm getting the following exception on the client when attempting to ... of code from the server, client, MarshalByRef object, and .config ... public void Start ... public event BombHandler BombDetonated; ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: What doesnt lend itself to OO?
    ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
    (comp.object)