[Mono-bugs] [Bug 66243][Nor] New - TcpClient.Connect work with hosts, but not with IP's as string
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 19 Sep 2004 14:51:40 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by fire4all@gmx.de.
http://bugzilla.ximian.com/show_bug.cgi?id=66243
--- shadow/66243 2004-09-19 14:51:40.000000000 -0400
+++ shadow/66243.tmp.11812 2004-09-19 14:51:40.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 66243
+Product: Mono: Runtime
+Version: unspecified
+OS:
+OS Details: Suse Linux 9.1
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: fire4all@gmx.de
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: TcpClient.Connect work with hosts, but not with IP's as string
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Hi, i have a little tool in windows and now i wana use that in linux. It
+uses relativ simple TCP/IP
+
+The TcpClient doesn't behave like in Microsoft.Net framework, nor your
+documentation:
+
+public TcpClient Conntect(string ip)
+{
+return new TcpClient(ip,5669);
+}
+throws an Socketexception, the host would be unkown (the stacktrace says u
+try to resolve an ip, but on this call it should be posible to give a host
+or an ipaddress... with every ipaddress is an Exception thrown.
+
+Same problem here:
+public TcpClient Conntect(string ip)
+{
+TcpClient client = new TcpClient(ip,5669);
+ client.Connect(ip,5669);
+return client;
+}
+
+If somebody wants to Connect to an IP instead of an host (symbolic name) he
+has to do that:
+
+public TcpClient Conntect(string ip)
+{
+TcpClient client = new TcpClient(ip,5669);
+client.Connect(IPAddress.Parse(ip),5669);
+return client;
+}
+
+Well the other two should do the same thing, Instead of throwing an Exception.
+
+Greets and Regards
+
+Ben