FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-28-2008, 06:15 AM
"Mike Mazur"
 
Default Mono/C#: cannot listen with TcpChannel

Hi,

Having trouble with TcpChannel throwing an exception:

$ cat temp_test.cs
using System;
using System.Net;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

public class MainClass
{
public static void Main()
{
try
{
TcpChannel ch = new TcpChannel(8895);
}
catch (Exception ex)
{
Console.WriteLine("Exception while attempting to
listen on TCP port 8895.");
throw (ex);
}
}
}
$ mcs -r:System.Runtime.Remoting.dll temp_test.cs
temp_test.cs(13,28): warning CS0219: The variable `ch' is assigned but
its value is never used
Compilation succeeded - 1 warning(s)
$ mono temp_test.exe
Exception while attempting to listen on TCP port 8895.

Unhandled Exception: System.Net.Sockets.SocketException: No such host is known
at System.Net.Dns.GetHostByName (System.String hostName) [0x00000]
at System.Net.Dns.Resolve (System.String hostName) [0x00000]
at System.Runtime.Remoting.Channels.Tcp.TcpServerChan nel.Init
(IServerChannelSinkProvider serverSinkProvider) [0x00000]
at System.Runtime.Remoting.Channels.Tcp.TcpServerChan nel..ctor
(IDictionary properties, IServerChannelSinkProvider
serverSinkProvider) [0x00000]
at System.Runtime.Remoting.Channels.Tcp.TcpChannel.In it (IDictionary
properties, IClientChannelSinkProvider clientSink,
IServerChannelSinkProvider serverSink) [0x00000]
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..c tor (Int32
port) [0x00000]
at MainClass.Main () [0x00000]

I also tried the example at
http://www.gotmono.com/docs/remoting/introduction.html but this
exhibits the same problem.

I'm new to Mono development, so I'm not too familiar with all its
libraries and/or components. Could I be missing something that's in
portage?

Thanks in advance,
Mike
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-28-2008, 09:17 AM
"Mike Mazur"
 
Default Mono/C#: cannot listen with TcpChannel

Hi,

On Mon, Apr 28, 2008 at 3:15 PM, Mike Mazur <mmazur@gmail.com> wrote:
> Hi,
>
> Having trouble with TcpChannel throwing an exception:
>
> [...]
>
> Unhandled Exception: System.Net.Sockets.SocketException: No such host is known
> at System.Net.Dns.GetHostByName (System.String hostName) [0x00000]
> at System.Net.Dns.Resolve (System.String hostName) [0x00000]
> at System.Runtime.Remoting.Channels.Tcp.TcpServerChan nel.Init
> (IServerChannelSinkProvider serverSinkProvider) [0x00000]
> at System.Runtime.Remoting.Channels.Tcp.TcpServerChan nel..ctor
> (IDictionary properties, IServerChannelSinkProvider
> serverSinkProvider) [0x00000]
> at System.Runtime.Remoting.Channels.Tcp.TcpChannel.In it (IDictionary
> properties, IClientChannelSinkProvider clientSink,
> IServerChannelSinkProvider serverSink) [0x00000]
> at System.Runtime.Remoting.Channels.Tcp.TcpChannel..c tor (Int32
> port) [0x00000]
> at MainClass.Main () [0x00000]

The fix was to put my machine's hostname in /etc/hosts.

Mike
--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 12:13 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org