Gentoo Archives: gentoo-user

From: Mike Mazur <mmazur@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Mono/C#: cannot listen with TcpChannel
Date: Mon, 28 Apr 2008 06:15:23
Message-Id: 184110a70804272315l28cccb11xe4e699871fb1ed00@mail.gmail.com
1 Hi,
2
3 Having trouble with TcpChannel throwing an exception:
4
5 $ cat temp_test.cs
6 using System;
7 using System.Net;
8 using System.Runtime.Remoting;
9 using System.Runtime.Remoting.Channels;
10 using System.Runtime.Remoting.Channels.Tcp;
11
12 public class MainClass
13 {
14 public static void Main()
15 {
16 try
17 {
18 TcpChannel ch = new TcpChannel(8895);
19 }
20 catch (Exception ex)
21 {
22 Console.WriteLine("Exception while attempting to
23 listen on TCP port 8895.");
24 throw (ex);
25 }
26 }
27 }
28 $ mcs -r:System.Runtime.Remoting.dll temp_test.cs
29 temp_test.cs(13,28): warning CS0219: The variable `ch' is assigned but
30 its value is never used
31 Compilation succeeded - 1 warning(s)
32 $ mono temp_test.exe
33 Exception while attempting to listen on TCP port 8895.
34
35 Unhandled Exception: System.Net.Sockets.SocketException: No such host is known
36 at System.Net.Dns.GetHostByName (System.String hostName) [0x00000]
37 at System.Net.Dns.Resolve (System.String hostName) [0x00000]
38 at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel.Init
39 (IServerChannelSinkProvider serverSinkProvider) [0x00000]
40 at System.Runtime.Remoting.Channels.Tcp.TcpServerChannel..ctor
41 (IDictionary properties, IServerChannelSinkProvider
42 serverSinkProvider) [0x00000]
43 at System.Runtime.Remoting.Channels.Tcp.TcpChannel.Init (IDictionary
44 properties, IClientChannelSinkProvider clientSink,
45 IServerChannelSinkProvider serverSink) [0x00000]
46 at System.Runtime.Remoting.Channels.Tcp.TcpChannel..ctor (Int32
47 port) [0x00000]
48 at MainClass.Main () [0x00000]
49
50 I also tried the example at
51 http://www.gotmono.com/docs/remoting/introduction.html but this
52 exhibits the same problem.
53
54 I'm new to Mono development, so I'm not too familiar with all its
55 libraries and/or components. Could I be missing something that's in
56 portage?
57
58 Thanks in advance,
59 Mike
60 --
61 gentoo-user@l.g.o mailing list

Replies

Subject Author
[gentoo-user] Re: Mono/C#: cannot listen with TcpChannel Mike Mazur <mmazur@×××××.com>