[Mono-list] Remoting problem
Hello there. I have a client/server app that runs on Windows, and I must make the server to run on Linux as well. I choosed the Mono for start. The problem is that if I have a remoting object that contains the following method in the Remoting object public Stream GetStream() { outputStream=(Stream)File.OpenWrite("Test.zip"); //outputStream is a class member return outputStream; } and I get a reference of this object on a client ( with Activator object ) and try to use the resulting Stream ( read/write or any other operation ), the client application hangs. This happens only when I run the server on Linux with Mono. On windows it works ok. Any suggestions? Regards Dan Cimpoiesu Cautam cinefili pentru premiere! Videomax.ro pune la bataie 172 premii in valoare de 117 milioane lei. Intra si tu in competitie!
[Mono-list] Remoting problem
Hello there. I have a client/server app that runs on Windows, and I must make the server to run on Linux as well. I choosed the Mono for start. The problem is that if I have a remoting object that contains the following method in the Remoting object public Stream GetStream() { outputStream=(Stream)File.OpenWrite("Test.zip"); //outputStream is a class member return outputStream; } and I get a reference of this object on a client ( with Activator object ) and try to use the resulting Stream ( read/write or any other operation ), the client application hangs. This happens only when I run the server on Linux with Mono. On windows it works ok. Any suggestions? Regards Dan Cimpoiesu
RE: [Mono-list] Remoting problem
Hi, could you please post the whole source for client and server? I've made my own test and everything works fine here. I use .NET Famework 2.0 beta on a win2003 server to run the client part and FC2 with mono 1.0 as server. Here ist my source: Client: #region Using directives using System; using System.IO; using System.Runtime.Remoting; using System.Runtime.Remoting.Activation; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; #endregion namespace StreamSerializationTest { class Program { static void Main() { ChannelServices.RegisterChannel(new TcpChannel()); string date = DateTime.Now.ToString(); Console.WriteLine("Write: " + date); object[] url = { new UrlAttribute("tcp://rre-fc2:1234") }; object[] args = { "test.txt", FileMode.Create }; StreamWriter sw = new StreamWriter((FileStream)Activator.CreateInstance(typeof(FileStream), args, url)); sw.WriteLine(date); sw.Close(); args = new object[] { "test.txt", FileMode.Open }; StreamReader sr = new StreamReader((FileStream)Activator.CreateInstance(typeof(FileStream), args, url)); Console.WriteLine("Read: " + sr.ReadLine()); sr.Close(); Console.ReadLine(); } } } Server: using System; using System.IO; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; class MainClass { public static void Main(string[] args) { ChannelServices.RegisterChannel(new TcpChannel(1234)); RemotingConfiguration.RegisterActivatedServiceType(typeof(FileStream)); Console.WriteLine("Press any key"); Console.ReadLine(); } } Robert From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Cimpoiesu Sent: Mittwoch, 11. August 2004 11:24 To: [EMAIL PROTECTED] Subject: [Mono-list] Remoting problem Hello there. I have a client/server app that runs on Windows, and I must make the server to run on Linux as well. I choosed the Mono for start. The problem is that if I have a remoting object that contains the following method in the Remoting object public Stream GetStream() { outputStream=(Stream)File.OpenWrite("Test.zip"); //outputStream is a class member return outputStream; } and I get a reference of this object on a client ( with Activator object ) and try to use the resulting Stream ( read/write or any other operation ), the client application hangs. This happens only when I run the server on Linux with Mono. On windows it works ok. Any suggestions? Regards Dan Cimpoiesu Cautam cinefili pentru premiere! <http://www.videomax.ro/NewsLetter/Step1.asp> Videomax.ro <http://www.videomax.ro/> pune la bataie 172 premii in valoare de 117 milioane lei. Intra si tu in competitie! ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Remoting problem on Mandrake 9.0
As my first statement in my program I have: ChannelServices.RegisterChannel(new TcpChannel(8085)); An I get the following exception: Unhandled Exception: System.Net.Sockets.SocketException: No such host is known in <0x000a0> 00 System.Net.Dns:GetHostByName (string) in <0x00057> 00 System.Runtime.Remoting.Channels.Tcp.TcpServerChannel:Init (System.Runtime.Remoting.Channels.IServerChannelSinkProvider) in <0x00103> 00 System.Runtime.Remoting.Channels.Tcp.TcpServerChannel:.ctor (System.Collections.IDictionary,System.Runtime.Remoting.Channels.IServerChannelSinkProvider) in <0x000da> 00 System.Runtime.Remoting.Channels.Tcp.TcpChannel:Init (System.Collections.IDictionary,System.Runtime.Remoting.Channels.IClientChannelSinkProvider,System.Runtime.Remoting.Channels.IServerChannelSinkProvider) in <0x00094> 00 System.Runtime.Remoting.Channels.Tcp.TcpChannel:.ctor (int) in <0x00031> 00 RemotingSamples.Server:Main (string[]) The hostname should be 'localhost' and System.Net.Dns.GetHostByName should return 127.0.0.1. Right? How can I provide more input? - Urs ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list