Mombu the Programming Forum

Go Back   Mombu the Programming Forum > Programming > the call to function in remote object is stuck (lock)
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 10th June 11:52
dave
External User
 
Posts: 1
Default the call to function in remote object is stuck (lock)



hi all,
I'm programming with VS2005 (c#) and I got problem when I implemented
local remoting
I created windows service that act like remote host, the service have
timer and run the
command RemotingConfiguration.Configure on OnStart function

the config file look like this:
<configuration>
<system.runtime.remoting>
<application name="RemoteHostService">
<service>
<wellknown type="RemoteObject.Sample, RemoteObject"
objectUri="RemoteObject.Sample" mode="Singleton" />
</service>
<channels>
<channel ref="tcp" port="8085">
<serverProviders>
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>

the remote object contains this code:
using System;
using System.Diagnostics;

namespace RemoteObject
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Sample : MarshalByRefObject
{
public Sample()
{
//
// TODO: Add constructor logic here
//
}
public int Run()
{
return 0;
}

}
}

the relevant code in the the remote client:
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
Sample samp = (Sample)Activator.GetObject(
typeof(RemoteObject.Sample),
"tcp://localhost:8085/RemoteObject.Sample");
if (samp == null)
System.Console.WriteLine("Could not locate server");
else
Console.WriteLine(samp.Run);

but the program stuck when it tries to call Run,
I'll appreciate if someone know how to fix it or why I have a problem
like this

Best Regards,
Dave
  Reply With Quote


 


Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Development, Ada, Apple script, Assembler, Awk, Beos, Basic, C, C++, C#, C# .net, .net, .net frameworks, Asp .net, Clarion, Clipper, Clos, Clu, Cobol, Coldfusion, Delphi, Dylan, Eiffel, Forth, Fortran, Haskell, Hermes, Icon, Idl, Java, Java script, Jscript .net, Jcl, Linoleum, Lisp, Lotus, Limbo, Logo, Ml, Mumps, Oberon, Postscript, Pop, Pl1, Prolog, Python, Ruby, Pascal, Perl, Php, Rebol, Rexx, Sed, Sather, Scheme, Smalltalk, Tcl, Vhdl, Vrml, Visual basic, Visual basic .net, Yorick, Mysql, Omnis, Postgresql, Xbase, Access, Oracle, Adabas, Berkeley, Btrieve, Filemaker, Gupta, Db2, Informix, Ingres, Mssql server, Object, Olap, Paradox, Rdb, Revelation, Sybase, Theory, Dbase, Html, Java script, Css, Flash, Photoshop, Corel script, Xml, Tech, Beos, Gem, Hp48, Hpux, Linux, Mac, Ms-dos, Os2, Palm, Solaris, Ti99, Windows, Xenix, Aos, Chorus, Geos, Inferno, Lantastic, Lynx, Mach, Minix, Netware, Os9, Parix, Plan9, Psos, Qnx, Xinu, Sco, Unix, Aix, Aux, 386bsd, Bsdi, Freebsd, Netbsd, Openbsd, Ultrix, Amd, Intel, Aptiva, Buz, Deals, Homebuilt, Overclocking, Programming, Extra forums


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666