4 msgScript to kill long-running application

Mono/C#: cannot listen with TcpChannel
\ Mike Mazur (28 Apr 2008)
. \ Mike Mazur (28 Apr 2008)

9 msgBatch audio converter?
5 msgrkhunter and /dev/dev
1 msgnscd doing IPV6 requests on an IPV4-only system...
4 msgNo mail from list
1 msgchkrootkit release 0.48
7 msgRootkit Hunter release 1.3.2
6 msgSplitting .mov files
4 msgGentoo for embedded-linux
3 msg[OT] gentoo-wiki.com
7 msgmktemp dependency problems
1 msgRe: adding python module
10 msgVery old machine blocking/update questions
1 msgnet-misc/nxserver-freeedition conectivity and r...
35 msgWould emerge --sync remove old profiles?
4 msg--as-needed in LDFLAGS - hot or not?
2 msgautomatically set default alsa card
4 msgfile does not recognize .ogg
5 msgKAudioCreator - Stopped Working
Subject:Mono/C#: cannot listen with TcpChannel
Group:Gentoo-user
From:Mike Mazur
Date:28 Apr 2008


 
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.TcpServerChannel.Init
(IServerChannelSinkProvider serverSinkProvider) [0x00000]
at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor
(IDictionary properties, IServerChannelSinkProvider
serverSinkProvider) [0x00000]
at System.Runtime.Remoting.Channels.Tcp.TcpChannel.Init (IDictionary
properties, IClientChannelSinkProvider clientSink,
IServerChannelSinkProvider serverSink) [0x00000]
at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor (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 mailing list



© 2004-2008 readlist.com