[Mono-list] Remoting with interface definition

Urs Muff umuff@quark.com
Mon, 31 Mar 2003 10:14:21 -0700


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C2F7A8.F89C1460
Content-Type: text/plain

Lluis,

Yes, interfaces do work now.  Good work!

Simple chat client however does not work.  Attached you see the exception
that is thrown, and all the source and binaries needed.  I hope this helps
tracking down the problem.  [Note this works on the MS.Net runtime, binaries
compiled with csc].

- URS C. MUFF

> -----Original Message-----
> From: Lluis Sanchez [mailto:lluis@ideary.com]
> Sent: Monday, March 31, 2003 7:29 AM
> To: Urs Muff; mono-list@lists.ximian.com
> Subject: Re: [Mono-list] Remoting with interface definition
> 
> Remoting with interface definitionThis should work now.
> 
> ----- Original Message -----
> From: Urs Muff
> To: 'mono-list@lists.ximian.com'
> Sent: Saturday, March 15, 2003 1:35 AM
> Subject: [Mono-list] Remoting with interface definition
> 
> 
> Using the following concept is not working on mono, but in the MS .Net
> framework:
> Common Lib:
> intercace IServerObj
> {
>         string Name { get; }
> }
> Client:
> main()
> {
>         ChannelServices.RegisterChannel(new TcpChannel(0));
> IServerObject server =
> Activation.GetObject(typeof(IServerObj),"tcp://localhost:8085/Test") as
> IServerObject;
> string name = server.Name;
> }
> Server:
> class ServerObject : MarshalByRefObject, IServerObject
> {
>         public string Name { get { return "Test Server"; } }
> }
> main()
> {
>         ChannelServices.RegisterChannel(new TcpChannel(8085));
> 
> RemotingConfiguration.RegisterWellKnownServiceType(typeof(HelloServer),"Te
> st
> ",WellKnownObjectMode.Singleton);
> }
> This is a very important concept, since it allows hiding the
> implementation
> from the Client.
> The crash is in corlib : Remoting.TypeInfo (since it assumes to be derived
> from object or MarshalByRefObject, which it is not, since it is a pure
> interface).  Fixing that does not help either since it crashes later than,
> since it still assumes it has to be a MarshalByRefObject (which it
> eventually should be since it will become a Proxy [right?]).  I'm not that
> familiar with the mono remoting implementation, but that seems like a
> design
> problem, unless I'm doing something wrong.
> - Urs C. Muff
> Systems Architect       - Research Lab


------_=_NextPart_000_01C2F7A8.F89C1460
Content-Type: application/octet-stream;
	name="Chat.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="Chat.tar.gz"

H4sIAFV2iD4AA+xcaXAcx3V+M7tYHCRAALxlSmxAVLQ4uFzwAgVKMsFDImWBRAjooCiGGuw2gBF3
Z6CZWYAgDZuKFVuJy46SyC6Vwh+SknIUV+xSUipZTknOYZWcH3GiJHIlqbhcSiVSVfQjR5Wr4kop
Vt573TM7ewCE7PCIwyHR08fr169fd7/pnm/eHijY0gkyOR8u35UdyGYHs1nI4rV7e3gf4DtFdw7s
huzg7p3bs4Pbd+7C/IHtO3YNgsheRpmiq+QHlicElIqlyckl6IpnZizfn8tfCZmu4FXybWdKjM37
gSzubY2nMsdLTmAXZea4LLoB5l+iOHNg2nIcWfCXS5cZz83sbW1tcayi9GesnBQhyZhVnClIv/V8
a/NMaaJg50SugMoXB3iy3m8VSlIMiRHL86etwv7543Ly2MSjMhf0iyOKpLUZqzb7gUdyFLECtdMc
MouxSWuaWavQI84zqbiDUnvFQrxKmQz5Eu/mKRnQjePNB1zHdwsy84BnB/Je25HpbtWIQDJxPrvQ
3U+se/YytSeDkudouTC90Mp/3GBlf6etQPNRPZrx7FkrkKE4p62CbfkosFMqUBfLPYwqhh1kyp5Q
+GDa9jNRbb7vZSHKLGZdOy9w7NJRJT1uY9KbtXPSxwGdsnGEPZ2fduScwCENk9meHqX15m3bxAFP
ktyWmPHcs/MicEUwLYVH4y2Fy4OXoTaOHJaFgktNSE/ksBc57ANG7xDDuYD67nqZu2WghjvN2gzm
Z6Q7mY7X7Onnku4gNzO0bVvBzVmFadcPhvZk9+zaNmbNM2k30fQI1EC8qha5zoCSNEKL0y36YtKp
YS2nMyMymHbzrJD4XOsel35Ac6gku1E5WKdWP0olhXmRlwU5ZQXWRCFUEDUyMn/AKhQmrNyZAzxD
cjpFcwBbqypOqyFG+YS+Wquao0q6JSkmXY+HpcjiYxQ7PO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G7XinWreBMPZgmMZwGEaNYTiC+Zs4fhi6
4FFjBJf2WeME55yCn+daJzAkX6sbzCI8BsOmD4/DgnkOaZ41P4PSfdX8HK4M6s1Gpicc8tfRHp+E
HIzDF7WX5EWkaWKcsZ1xxuSFaiswAz+pr+QzNb6SsR3KT+MrGQcb4/HQIU+l9H5Og4mLAJpxf7pl
QoUh5qkhw0yO+SufyuUBeAqIi7BW3BxPkMffcW5xcYCu1rmyGjfVAKhG8kIcNDrslCVg38Frzylz
2X6YdU9UUOdUBEudssrOlpEPp/K5xOtG5Q0pGFdw2M+QPCQHMC8DsHl/jf+gQp4y/A9uGWP8YVZ7
PxbZw/J/2jt/FQSBOI4bRv/AwIPG4JagBiGLBodaot4jDAoiApt6gqbeoaXnaO892htag+7naXdQ
EkF/6ftxEJU7T8HD8+tHx2GuIesJTUv7yp98pg1p6W0gDv7K3LF1f3Myl539dqLyWDPD8pStirkt
M1gtdS2JPj8yGmXwKvoLVqYpY5ip2FiUYW4lnU2xCgW40ncMM1olPLZIePTsdk4UZF7R7mlWo57k
GsaxqvqWYny/eIuavpDsKxo/n+c+ynfmv/D/nuf/6df3t/h/SW1C/vsGuBxPcO/TDQGfYDh7/T7u
5L/1Bj3zi57/ubTedd0mvv/2Fqb+nDsj7jjiLJDxI0ZXwSBYcOWFcmfGtfdArUJcJEhKeGlTVIJf
3i+gatRQ7sFauvFfCqgW9fEcq3D/AAEAAAAAAAAAAAAAAACAP+QMYY+2eAB4AAA=

------_=_NextPart_000_01C2F7A8.F89C1460
Content-Type: application/octet-stream;
	name="error.log"
Content-Disposition: attachment;
	filename="error.log"

Unhandled Exception: System.Runtime.Remoting.RemotingException: No receiver
for uri /80fe8269_8a50_4580_94f3_228a57e96a00/554741679_2in [0x00026] (at
/home/umuff/mono/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs:101)
00 System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
(System.Runtime.Remoting.Proxies.RealProxy,System.Runtime.Remoting.Messaging.IMessage,System.Exception&,object[]&)
in (unmanaged) 07 RemotingSamples.AbstractEventHandler:SubmissionCallback
(object,RemotingSamples.SubmitEventArgs)
in <0x00004> 07 RemotingSamples.AbstractEventHandler:SubmissionCallback
(object,RemotingSamples.SubmitEventArgs)
in <0x00067> 01 System.MulticastDelegate:invoke_void_object_SubmitEventArgs
(object,RemotingSamples.SubmitEventArgs)
in <0x0011f> 00 RemotingSamples.HelloServer:Submit (string,string)
in (unmanaged) mono [0x80a1e32]
in (unmanaged) mono(mono_runtime_invoke+0x27) [0x80c172f]
in (unmanaged) mono(mono_runtime_invoke_array+0x1fd) [0x80c236d]
in (unmanaged) mono [0x80c7fcb]
in [0x00029] (at
/home/umuff/mono/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:63)
00 System.Runtime.Remoting.RemotingServices:InternalExecuteMessage
(System.MarshalByRefObject,System.Runtime.Remoting.Messaging.IMethodCallMessage)


Exception rethrown at [1]:

in [0x00026] (at
/home/umuff/mono/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs:101)
00 System.Runtime.Remoting.Proxies.RealProxy:PrivateInvoke
(System.Runtime.Remoting.Proxies.RealProxy,System.Runtime.Remoting.Messaging.IMessage,System.Exception&,object[]&)
in (unmanaged) 07 RemotingSamples.IHelloServer:Submit (string,string)
in <0x00004> 07 RemotingSamples.IHelloServer:Submit (string,string)
in <0x0024c> 00 RemotingSamples.ChatClient:Run ()
in <0x00074> 00 RemotingSamples.ChatClient:Main (string[])


------_=_NextPart_000_01C2F7A8.F89C1460--