[Mono-list] System.Net.Sockets.SocketException
   
    Timothy Parez
     
    tpsoftware@users.sourceforge.net
       
    Thu, 20 Mar 2003 00:19:17 +0100
    
    
  
This is a multi-part message in MIME format.
------=_NextPart_000_0014_01C2EE76.58548180
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Update 2:
The error doesn't seem to be gone at all :(
So the problem remains.
  ----- Original Message -----=20
  From: Timothy Parez=20
  To: mono-list@ximian.com=20
  Sent: Wednesday, March 19, 2003 11:52 PM
  Subject: Re: [Mono-list] System.Net.Sockets.SocketException
  Update:
  It seems that when I changed everything to ASCII instead of UTF7 =
everything works fine and there are no more socket exceptions. Although =
I don't get the link between the encoding and the socket exceptions, so =
it may be co=EFncidence.
  Can someone verify this ?
    ----- Original Message -----=20
    From: Timothy Parez=20
    To: mono-list@ximian.com=20
    Sent: Wednesday, March 19, 2003 11:08 PM
    Subject: [Mono-list] System.Net.Sockets.SocketException
    Hi,
    I'm writing a set of class libs for .NET/Mono,
    except for the UTF7 Encoding in my other post, it should work fine.
    And it does on .NET, but not on Mono.
    I don't know where to start, but I'll try to explain.
    First of all I have a Base Class which amongst other members has the =
following function
     private void ExecuteQuery()
      {
       UdpClient client =3D new UdpClient();
       //Connect to the server and send the query data
       try
       {
        client.Connect(ip,port);
        client.Send(data,data.Length);
       }
       catch
       {
        client.Close();
        throw new Exceptions.InvalidHostException("Unknown host: " + =
ip);
       }
       //Listen for a response - This is the client side
       IPEndPoint serverIPEndPoint =3D new IPEndPoint(IPAddress.Any,0);
      =20
       //Receive the response
       try
       {
        queryResponse =3D client.Receive(ref serverIPEndPoint);
       }
       catch (Exception e)
       {
        throw new Exceptions.ConnectionRefusedException("The connection =
was refused by the remote host: " + ip + ":" + port.ToString() + "\n" + =
e.Message,e);
       }
       finally
       {
        client.Close();
       }
      }
    As you can see it sends a n array of bytes to the server and =
receives some in return.
    Then I have a derived class which has 2 important functions:
      public string RequestStatus()
      {
       //Create the byte[] array to send
       byte[] query =3D =
{0xFF,0xFF,0xFF,0xFF,0x67,0x65,0x74,0x73,0x74,0x61,0x74,0x75,0x73,0xA};
      =20
       //Create a new separator
       char separator =3D Convert.ToChar(10);
       //A statusRequest consists of both rules and players separated by =
char(10)
       string[] response =3D this.QueryToString(query).Split(separator);
      =20
       //Get the rules and players
       string rules =3D this.RulesToXml(response[0]);
       string players =3D this.PlayersToXml(response);
     =20
       return =
this.CreateXmlBody("Quake3","statusRequest",string.Concat(rules,players))=
;
      }
    And
      public string RequestInfo()
      {
       //Create the byte[] array to send
       byte[] query =3D =
{0xFF,0xFF,0xFF,0xFF,0x67,0x65,0x74,0x69,0x6E,0x66,0x6F,0xA};
      =20
       //Query the server and get the response in a string
       string response =3D this.QueryToString(query);
      =20
       //Create the default xml body and put the rules in it
       string returnValue =3D =
this.CreateXmlBody("Quake3","infoRequest",this.RulesToXml(response));
       //return the XML
       return returnValue;
      }
    As you can see there is almost no difference between them.
    Now they both run fine with the .NET runtime, but with the mono =
runtime the .RequestStatus() fails.
    When does it fail well when the QueryToString function is called,
    so if I run RequestInfo() the QueryToString function is called and =
it all works fine,
    if I run RequestStatus() the QueryToString function is called and it =
goes wrong.
    In my opinion the only difference so far is the array of bytes to be =
sent.
    Example:
    Let's say I use the following code for an application
    using System;
    using TPSoftware.Q3PlugsNet;
    using TPSoftware.Q3PlugsNet.Exceptions;
    class MainClass
    {
     public static void Main(string[] args)
     {
         =20
      //Create a new Q3Query
    =20
     // Q3Query quakeClient =3D new Q3Query("195.130.132.153",27961);
      Q3Query quakeClient =3D new Q3Query("195.130.132.155",27961);
     =20
      try
      {
       string info =3D quakeClient.RequestStatus();
       Console.WriteLine(info);
      }
      catch (Exception e)
      {
       Console.WriteLine("ERROR:");
       Console.WriteLine("\n" + e.ToString());         =20
               =20
      }
      finally
      {
      Console.ReadLine();
      }
     }
    }
    Well then I get the following result with .NET runtime
    <?xml version=3D"1.0" encoding=3D"utf-7" =
standalone=3D"yes"?><Q3Plugs.NET><Query type=3D
    "statusRequest" protocol=3D"Quake3"><Server =
ipadress=3D"195.130.132.155" port=3D"27961
    " /><Rules count=3D"28"><rule =
name=3D"capturelimit"><![CDATA[8]]></rule><rule name=3D"
    sv_floodProtect"><![CDATA[0]]></rule><rule =
name=3D"sv_maxPing"><![CDATA[0]]></rule
    ><rule name=3D"sv_minPing"><![CDATA[0]]></rule><rule =
name=3D"sv_maxRate"><![CDATA[15
    000]]></rule><rule name=3D"sv_punkbuster"><![CDATA[0]]></rule><rule =
name=3D"sv_maxcl
    ients"><![CDATA[14]]></rule><rule =
name=3D"sv_hostname"><![CDATA[Telenet Q3A OSP CA
     Server]]></rule><rule name=3D"timelimit"><![CDATA[0]]></rule><rule =
name=3D"fraglimi
    t"><![CDATA[25]]></rule><rule =
name=3D"dmflags"><![CDATA[8]]></rule><rule name=3D"ver
    sion"><![CDATA[Q3 1.32 linux-i386 Oct  7 2002]]></rule><rule =
name=3D"g_gametype"><
    ![CDATA[5]]></rule><rule =
name=3D"protocol"><![CDATA[68]]></rule><rule name=3D"mapnam
    e"><![CDATA[q3dm6]]></rule><rule =
name=3D"sv_privateClients"><![CDATA[2]]></rule><r
    ule name=3D"sv_allowDownload"><![CDATA[1]]></rule><rule =
name=3D"server_promode"><![C
    DATA[0]]></rule><rule name=3D"server_cq3"><![CDATA[0]]></rule><rule =
name=3D"g_needpa
    ss"><![CDATA[0]]></rule><rule =
name=3D"server_ospauth"><![CDATA[2]]></rule><rule na
    me=3D"gamename"><![CDATA[osp]]></rule><rule =
name=3D"gameversion"><![CDATA[OSP v1.03]
    ]></rule><rule name=3D"Players_Red"><![CDATA[2 4 6 8 10 =
]]></rule><rule name=3D"Play
    ers_Blue"><![CDATA[1 3 5 7 9 ]]></rule><rule =
name=3D"Score_Red"><![CDATA[15]]></ru
    le><rule name=3D"Score_Blue"><![CDATA[17]]></rule><rule =
name=3D"Score_Time"><![CDATA
    [Round 33/49]]></rule></Rules><Players count=3D"10"><Player =
score=3D"20" ping=3D"15"><
    ![CDATA["^5DA^4.^5Ch^7a^5o^7s"]]></Player><Player score=3D"12" =
ping=3D"24"><![CDATA[
    "UnnamedPlaye^1r"]]></Player><Player score=3D"48" =
ping=3D"38"><![CDATA["^b^0*^n^7mnl
    ^b^0*"]]></Player><Player score=3D"38" =
ping=3D"38"><![CDATA["^xffffff^9eHk^b^4*^n^0T
    ^9N^0T"]]></Player><Player score=3D"80" =
ping=3D"25"><![CDATA["^5B^7osje^5R"]]></Play
    er><Player score=3D"85" =
ping=3D"24"><![CDATA["^x00FF00^2911^xFFFFFF^0>>^7SaTo"]]></P
    layer><Player score=3D"18" =
ping=3D"52"><![CDATA["^4jerome"]]></Player><Player score=3D
    "96" =
ping=3D"41"><![CDATA["^x3366FF^7e^0C^7'.E^0mo^7Z"]]></Player><Player =
score=3D"1
    1" ping=3D"16"><![CDATA["crypto"]]></Player><Player score=3D"73" =
ping=3D"40"><![CDATA[
    "^0fearl^33^0ss"]]></Player></Players></Query></Q3Plugs.NET>
    But I get the following with the mono runtime:
    Unhandled Exception: =
TPSoftware.Q3PlugsNet.Exceptions.ConnectionRefusedException
    : The connection was refused by the remote host: =
195.130.132.155:27961
    Some sort of w32 error occurred ---> =
System.Net.Sockets.SocketException: Some so
    rt of w32 error occurred
    in (unmanaged) 06 System.Net.Sockets.Socket:RecvFrom_internal =
(intptr,byte[],int
    ,int,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&)
    in <0x00004> 06 System.Net.Sockets.Socket:RecvFrom_internal =
(intptr,byte[],int,i
    nt,System.Net.Sockets.SocketFlags,System.Net.SocketAddress&)
    in <0x00155> 00 System.Net.Sockets.Socket:ReceiveFrom =
(byte[],int,int,System.Net
    .Sockets.SocketFlags,System.Net.EndPoint&)
    in <0x00180> 00 System.Net.Sockets.Socket:ReceiveFrom =
(byte[],int,int,System.Net
    .Sockets.SocketFlags,System.Net.EndPoint&)
    in <0x0002a> 00 System.Net.Sockets.Socket:ReceiveFrom =
(byte[],System.Net.EndPoin
    t&)
    in <0x000af> 00 System.Net.Sockets.UdpClient:Receive =
(System.Net.IPEndPoint&)
    in <0x0016b> 00 TPSoftware.Q3PlugsNet.QueryBase:ExecuteQuery ()
    --- End of inner exception stack trace ---
    in <0x002b4> 00 TPSoftware.Q3PlugsNet.QueryBase:ExecuteQuery ()
    in <0x0005b> 01 System.MulticastDelegate:invoke_void ()
    However if I change the above code to:
    using System;
    using TPSoftware.Q3PlugsNet;
    using TPSoftware.Q3PlugsNet.Exceptions;
    class MainClass
    {
     public static void Main(string[] args)
     {
         =20
      //Create a new Q3Query
    =20
     // Q3Query quakeClient =3D new Q3Query("195.130.132.153",27961);
      Q3Query quakeClient =3D new Q3Query("195.130.132.155",27961);
     =20
      try
      {
       string info =3D quakeClient.RequestInfo(); // RequestInfo instead =
of RequestStatus !!!!!!!!
       Console.WriteLine(info);
      }
      catch (Exception e)
      {
       Console.WriteLine("ERROR:");
       Console.WriteLine("\n" + e.ToString());         =20
               =20
      }
      finally
      {
      Console.ReadLine();
      }
     }
    }
    I get the following output with .NET
    <?xml version=3D"1.0" encoding=3D"utf-7" =
standalone=3D"yes"?><Q3Plugs.NET><Query type=3D
    "infoRequest" protocol=3D"Quake3"><Server =
ipadress=3D"195.130.132.155" port=3D"27961"
    /><Rules count=3D"9"><rule name=3D"game"><![CDATA[osp]]></rule><rule =
name=3D"punkbuste
    r"><![CDATA[0]]></rule><rule name=3D"pure"><![CDATA[1]]></rule><rule =
name=3D"gametyp
    e"><![CDATA[5]]></rule><rule =
name=3D"sv_maxclients"><![CDATA[12]]></rule><rule nam
    e=3D"clients"><![CDATA[2]]></rule><rule =
name=3D"mapname"><![CDATA[q3dm6]]></rule><ru
    le name=3D"hostname"><![CDATA[Telenet Q3A OSP CA =
Server]]></rule><rule name=3D"proto
    col"><![CDATA[68]]></rule></Rules></Query></Q3Plugs.NET>
    And the following output with mono (don't mind the encoding, that's =
another bug)
    ???xml version???1.0?? encoding???utf-7?? standalone???yes???? =
??Q3Plugs.NET? ??
    Query type???infoRequest?? protocol???Quake3??? ??Server =
ipadress???195.130.132.
    155?? port???27961?? /? ???Rules count????+BDJAAARO????? =
name?????+BDJAAARO???+E
    JwMQFQE+AFs-osp???+-???/rule???+QAA-rule =
name???????+BDJAAARO???+EJwMQFQE+AFs-0?
    ??+-???/rule???+QAA-rule =
name?????+BDJAAARO???+EJwMQFQE+AFs-1???+-???/rule???+QA
    A-rule =
name??????+BDJAAARO???+EJwMQFQE+AFs-5???+-???/rule???+QAA-rule =
name????+B
    G8AAA-maxclients???+AAAETEEl???+-AFs-12???+-???/rule???+QAA-rule =
name??????+BDJA
    AARO???+EJwMQFQE+AFs-2???+-???/rule???+QAA-rule =
name??????+BDJAAARO???+EJwMQFQE+
    AFs-q3dm6???+-???/rule???+QAA-rule =
name??????+BDJAAARO???+EJwMQFQE+AFs-Telenet Q
    3A OSP CA Server???+-???/rule???+QAA-rule =
name??????+BDJAAARO???+EJwMQFQE+AFs-68
    ???+-???/rule???+QAA-/Rules?????/Query? ??/Q3Plugs.NET?
    So this works fine (more or less) and doesn't throw any errors.
    So my question: Why does RequestStatus cause an error while =
RequestInfo does not.
    If you want to view the full sources of the library please visit:
    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/q3plugs/Q3Plugs.NET/
    Thnx,
    Timothy P.
    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.463 / Virus Database: 262 - Release Date: 17/03/2003
    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.463 / Virus Database: 262 - Release Date: 18/03/2003
------=_NextPart_000_0014_01C2EE76.58548180
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Update 2:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The error doesn't seem to be gone at =
all=20
:(</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>So the problem remains.</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dtpsoftware@users.sourceforge.net=20
  href=3D"mailto:tpsoftware@users.sourceforge.net">Timothy Parez</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dmono-list@ximian.com=20
  href=3D"mailto:mono-list@ximian.com">mono-list@ximian.com</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, March 19, 2003 =
11:52=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: [Mono-list]=20
  System.Net.Sockets.SocketException</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Update:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV><FONT face=3DArial size=3D2>It seems that when I changed =
everything to ASCII=20
  instead of UTF7 everything works fine and there are no more socket =
exceptions.=20
  Although I don't get the link between the encoding and the socket =
exceptions,=20
  so it may be co=EFncidence.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
  <DIV><FONT face=3DArial size=3D2>Can someone verify this =
?</FONT></DIV>
  <BLOCKQUOTE dir=3Dltr=20
  style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV=20
    style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
    <A title=3Dtpsoftware@users.sourceforge.net=20
    href=3D"mailto:tpsoftware@users.sourceforge.net">Timothy Parez</A> =
</DIV>
    <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dmono-list@ximian.com=20
    href=3D"mailto:mono-list@ximian.com">mono-list@ximian.com</A> </DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Wednesday, March 19, =
2003 11:08=20
    PM</DIV>
    <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Mono-list]=20
    System.Net.Sockets.SocketException</DIV>
    <DIV><BR></DIV>
    <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>I'm writing a set of class libs for =
    .NET/Mono,</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>except for the UTF7 Encoding in my =
other post,=20
    it should work fine.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>And it does on .NET, but not on=20
    Mono.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>I don't know where to start, but =
I'll try to=20
    explain.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>First of all I have a Base Class =
which amongst=20
    other members has the following function</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2> private void=20
    ExecuteQuery()<BR>  {<BR>   UdpClient =
client =3D new=20
    UdpClient();<BR>   //Connect to the server and send =
the query=20
    =
data<BR>   try<BR>   {<BR>   =
; client.Connect(ip,port);<BR>    client.Send(da=
ta,data.Length);<BR>   }<BR>   catch<BR>&nb=
sp;  {<BR>    client.Close();<BR> &nbs=
p;  throw=20
    new Exceptions.InvalidHostException("Unknown host: " +=20
    ip);<BR>   }</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>   //Listen for a =
response -=20
    This is the client side<BR>   IPEndPoint =
serverIPEndPoint =3D=20
    new=20
    =
IPEndPoint(IPAddress.Any,0);<BR>   <BR>   /=
/Receive=20
    the=20
    =
response<BR>   try<BR>   {<BR>  &=
nbsp; queryResponse=20
    =3D client.Receive(ref=20
    serverIPEndPoint);<BR>   }<BR>   catch =
    (Exception =
e)<BR>   {<BR>    throw new=20
    Exceptions.ConnectionRefusedException("The connection was refused by =
the=20
    remote host: " + ip + ":" + port.ToString() + "\n" +=20
    =
e.Message,e);<BR>   }<BR>   finally<BR>&nbs=
p;  {<BR>    client.Close();<BR>  =
; }<BR>  }</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>As you can see it sends a n array =
of bytes to=20
    the server and receives some in return.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Then I have a derived class which =
has 2=20
    important functions:</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>  public string=20
    RequestStatus()<BR>  {<BR>   //Create the =
byte[]=20
    array to send<BR>   byte[] query =3D=20
    =
{0xFF,0xFF,0xFF,0xFF,0x67,0x65,0x74,0x73,0x74,0x61,0x74,0x75,0x73,0xA};<B=
R>   <BR>   //Create=20
    a new separator<BR>   char separator =3D=20
    Convert.ToChar(10);</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>   //A statusRequest =
consists of=20
    both rules and players separated by =
char(10)<BR>   string[]=20
    response =3D=20
    =
this.QueryToString(query).Split(separator);<BR>   <BR>&nbs=
p;  //Get=20
    the rules and players<BR>   string rules =3D=20
    this.RulesToXml(response[0]);<BR>   string players =
=3D=20
    =
this.PlayersToXml(response);<BR>  <BR>   return =
    =
this.CreateXmlBody("Quake3","statusRequest",string.Concat(rules,players))=
;<BR>  }</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>And</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>  public string=20
    RequestInfo()<BR>  {<BR>   //Create the =
byte[]=20
    array to send<BR>   byte[] query =3D=20
    =
{0xFF,0xFF,0xFF,0xFF,0x67,0x65,0x74,0x69,0x6E,0x66,0x6F,0xA};<BR> &n=
bsp; <BR>   //Query=20
    the server and get the response in a =
string<BR>   string=20
    response =3D=20
    =
this.QueryToString(query);<BR>   <BR>   //C=
reate=20
    the default xml body and put the rules in =
it<BR>   string=20
    returnValue =3D=20
    =
this.CreateXmlBody("Quake3","infoRequest",this.RulesToXml(response));</FO=
NT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>   //return the=20
    XML<BR>   return =
returnValue;<BR>  }</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>As you can see there is almost no =
difference=20
    between them.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>Now they both run fine with the =
.NET runtime,=20
    but with the mono runtime the .RequestStatus() fails.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>When does it fail well when the =
QueryToString=20
    function is called,</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>so if I run RequestInfo() the =
QueryToString=20
    function is called and it all works fine,</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>if I run RequestStatus() the =
QueryToString=20
    function is called and it goes wrong.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>In my opinion the only difference =
so far is the=20
    array of bytes to be sent.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Example:</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Let's say I use the following code =
for an=20
    application</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>using System;<BR>using=20
    TPSoftware.Q3PlugsNet;<BR>using=20
    TPSoftware.Q3PlugsNet.Exceptions;</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>class =
MainClass<BR>{<BR> public static=20
    void Main(string[]=20
    =
args)<BR> {<BR>      <BR>  /=
/Create=20
    a new Q3Query<BR> <BR> // Q3Query quakeClient =3D new =
    Q3Query("195.130.132.153",27961);<BR>  Q3Query quakeClient =
=3D new=20
    =
Q3Query("195.130.132.155",27961);<BR>  <BR>  try<BR>&=
nbsp; {<BR>   string=20
    info =3D=20
    =
quakeClient.RequestStatus();<BR>   Console.WriteLine(info)=
;<BR>  }<BR>  catch=20
    (Exception=20
    =
e)<BR>  {<BR>   Console.WriteLine("ERROR:");<BR>=
   Console.WriteLine("\n"=20
    + =
e.ToString());         =20
    </FONT></DIV>
    <DIV><FONT face=3DArial=20
    =
size=3D2>          &nbs=
p; <BR>  }<BR>  finally<BR>  {<BR>&nbs=
p; Console.ReadLine();<BR>  }<BR> }<BR>}<BR></FONT></=
DIV>
    <DIV><FONT face=3DArial size=3D2>Well then I get the following =
result with .NET=20
    runtime</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2><?xml version=3D"1.0" =
encoding=3D"utf-7"=20
    standalone=3D"yes"?><Q3Plugs.NET><Query =
type=3D<BR>"statusRequest"=20
    protocol=3D"Quake3"><Server ipadress=3D"195.130.132.155" =
port=3D"27961<BR>"=20
    /><Rules count=3D"28"><rule=20
    name=3D"capturelimit"><![CDATA[8]]></rule><rule=20
    =
name=3D"<BR>sv_floodProtect"><![CDATA[0]]></rule><rule =
    name=3D"sv_maxPing"><![CDATA[0]]></rule<BR>><rule=20
    name=3D"sv_minPing"><![CDATA[0]]></rule><rule=20
    =
name=3D"sv_maxRate"><![CDATA[15<BR>000]]></rule><rule=20
    name=3D"sv_punkbuster"><![CDATA[0]]></rule><rule=20
    =
name=3D"sv_maxcl<BR>ients"><![CDATA[14]]></rule><rule=20
    name=3D"sv_hostname"><![CDATA[Telenet Q3A OSP=20
    CA<BR> Server]]></rule><rule=20
    name=3D"timelimit"><![CDATA[0]]></rule><rule=20
    name=3D"fraglimi<BR>t"><![CDATA[25]]></rule><rule=20
    name=3D"dmflags"><![CDATA[8]]></rule><rule=20
    name=3D"ver<BR>sion"><![CDATA[Q3 1.32 linux-i386 Oct  7=20
    2002]]></rule><rule=20
    name=3D"g_gametype"><<BR>![CDATA[5]]></rule><rule=20
    name=3D"protocol"><![CDATA[68]]></rule><rule=20
    name=3D"mapnam<BR>e"><![CDATA[q3dm6]]></rule><rule =
    =
name=3D"sv_privateClients"><![CDATA[2]]></rule><r<BR>ul=
e=20
    =
name=3D"sv_allowDownload"><![CDATA[1]]></rule><rule=20
    =
name=3D"server_promode"><![C<BR>DATA[0]]></rule><rule=20
    name=3D"server_cq3"><![CDATA[0]]></rule><rule=20
    name=3D"g_needpa<BR>ss"><![CDATA[0]]></rule><rule=20
    name=3D"server_ospauth"><![CDATA[2]]></rule><rule=20
    na<BR>me=3D"gamename"><![CDATA[osp]]></rule><rule=20
    name=3D"gameversion"><![CDATA[OSP =
v1.03]<BR>]></rule><rule=20
    name=3D"Players_Red"><![CDATA[2 4 6 8 10 =
]]></rule><rule=20
    name=3D"Play<BR>ers_Blue"><![CDATA[1 3 5 7 9 =
]]></rule><rule=20
    name=3D"Score_Red"><![CDATA[15]]></ru<BR>le><rule=20
    name=3D"Score_Blue"><![CDATA[17]]></rule><rule=20
    name=3D"Score_Time"><![CDATA<BR>[Round=20
    33/49]]></rule></Rules><Players =
count=3D"10"><Player=20
    score=3D"20"=20
    =
ping=3D"15"><<BR>![CDATA["^5DA^4.^5Ch^7a^5o^7s"]]></Player>=
;<Player=20
    score=3D"12"=20
    =
ping=3D"24"><![CDATA[<BR>"UnnamedPlaye^1r"]]></Player><=
Player=20
    score=3D"48"=20
    =
ping=3D"38"><![CDATA["^b^0*^n^7mnl<BR>^b^0*"]]></Player>&l=
t;Player=20
    score=3D"38"=20
    =
ping=3D"38"><![CDATA["^xffffff^9eHk^b^4*^n^0T<BR>^9N^0T"]]></=
Player><Player=20
    score=3D"80"=20
    =
ping=3D"25"><![CDATA["^5B^7osje^5R"]]></Play<BR>er><Pla=
yer=20
    score=3D"85"=20
    =
ping=3D"24"><![CDATA["^x00FF00^2911^xFFFFFF^0>>^7SaTo"]]>&=
lt;/P<BR>layer><Player=20
    score=3D"18"=20
    ping=3D"52"><![CDATA["^4jerome"]]></Player><Player =
    score=3D<BR>"96"=20
    =
ping=3D"41"><![CDATA["^x3366FF^7e^0C^7'.E^0mo^7Z"]]></Player&=
gt;<Player=20
    score=3D"1<BR>1"=20
    ping=3D"16"><![CDATA["crypto"]]></Player><Player =
score=3D"73"=20
    =
ping=3D"40"><![CDATA[<BR>"^0fearl^33^0ss"]]></Player></=
Players></Query></Q3Plugs.NET><BR></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>But I get the following with the =
mono=20
    runtime:</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>Unhandled Exception:=20
    TPSoftware.Q3PlugsNet.Exceptions.ConnectionRefusedException<BR>: The =
    connection was refused by the remote host: =
195.130.132.155:27961<BR>Some=20
    sort of w32 error occurred ---> =
System.Net.Sockets.SocketException: Some=20
    so<BR>rt of w32 error occurred<BR>in (unmanaged) 06=20
    System.Net.Sockets.Socket:RecvFrom_internal=20
    =
(intptr,byte[],int<BR>,int,System.Net.Sockets.SocketFlags,System.Net.Sock=
etAddress&)<BR>in=20
    <0x00004> 06 System.Net.Sockets.Socket:RecvFrom_internal=20
    =
(intptr,byte[],int,i<BR>nt,System.Net.Sockets.SocketFlags,System.Net.Sock=
etAddress&)<BR>in=20
    <0x00155> 00 System.Net.Sockets.Socket:ReceiveFrom=20
    =
(byte[],int,int,System.Net<BR>.Sockets.SocketFlags,System.Net.EndPoint&am=
p;)<BR>in=20
    <0x00180> 00 System.Net.Sockets.Socket:ReceiveFrom=20
    =
(byte[],int,int,System.Net<BR>.Sockets.SocketFlags,System.Net.EndPoint&am=
p;)<BR>in=20
    <0x0002a> 00 System.Net.Sockets.Socket:ReceiveFrom=20
    (byte[],System.Net.EndPoin<BR>t&)<BR>in <0x000af> 00=20
    System.Net.Sockets.UdpClient:Receive =
(System.Net.IPEndPoint&)<BR>in=20
    <0x0016b> 00 TPSoftware.Q3PlugsNet.QueryBase:ExecuteQuery =
()<BR>---=20
    End of inner exception stack trace ---</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>in <0x002b4> 00=20
    TPSoftware.Q3PlugsNet.QueryBase:ExecuteQuery ()<BR>in =
<0x0005b> 01=20
    System.MulticastDelegate:invoke_void ()<BR></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>However if I change the above code=20
    to:</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2>using System;<BR>using=20
    TPSoftware.Q3PlugsNet;<BR>using=20
    TPSoftware.Q3PlugsNet.Exceptions;</FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial size=3D2>class =
MainClass<BR>{<BR> public static=20
    void Main(string[]=20
    =
args)<BR> {<BR>      <BR>  /=
/Create=20
    a new Q3Query<BR> <BR> // Q3Query quakeClient =3D new =
    Q3Query("195.130.132.153",27961);<BR>  Q3Query quakeClient =
=3D new=20
    =
Q3Query("195.130.132.155",27961);<BR>  <BR>  try<BR>&=
nbsp; {<BR>   string=20
    info =3D quakeClient.RequestInfo(); // RequestInfo instead of =
RequestStatus=20
    =
!!!!!!!!<BR>   Console.WriteLine(info);<BR>  }<B=
R>  catch=20
    (Exception=20
    =
e)<BR>  {<BR>   Console.WriteLine("ERROR:");<BR>=
   Console.WriteLine("\n"=20
    + =
e.ToString());         =20
    </FONT></DIV>
    <DIV> </DIV>
    <DIV><FONT face=3DArial=20
    =
size=3D2>          &nbs=
p;=20
    =
<BR>  }<BR>  finally<BR>  {<BR>  =
Console.ReadLine();<BR>  }<BR> }<BR>}</DIV></FONT>
    <DIV><FONT face=3DArial size=3D2> </DIV></FONT>
    <DIV><FONT face=3DArial size=3D2>I get the following output with=20
    .NET</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV><FONT face=3DArial size=3D2><?xml version=3D"1.0" =
encoding=3D"utf-7"=20
    standalone=3D"yes"?><Q3Plugs.NET><Query =
type=3D<BR>"infoRequest"=20
    protocol=3D"Quake3"><Server ipadress=3D"195.130.132.155"=20
    port=3D"27961"<BR>/><Rules count=3D"9"><rule=20
    name=3D"game"><![CDATA[osp]]></rule><rule=20
    name=3D"punkbuste<BR>r"><![CDATA[0]]></rule><rule=20
    name=3D"pure"><![CDATA[1]]></rule><rule=20
    name=3D"gametyp<BR>e"><![CDATA[5]]></rule><rule=20
    name=3D"sv_maxclients"><![CDATA[12]]></rule><rule=20
    nam<BR>e=3D"clients"><![CDATA[2]]></rule><rule=20
    name=3D"mapname"><![CDATA[q3dm6]]></rule><ru<BR>le =
    name=3D"hostname"><![CDATA[Telenet Q3A OSP CA=20
    Server]]></rule><rule=20
    =
name=3D"proto<BR>col"><![CDATA[68]]></rule></Rules>&=
lt;/Query></Q3Plugs.NET><BR></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>And the following output with mono =
(don't mind=20
    the encoding, that's another bug)</FONT></DIV><FONT face=3DArial =
size=3D2>
    <DIV><BR>???xml version???1.0?? encoding???utf-7?? =
standalone???yes????=20
    ??Q3Plugs.NET? ??<BR>Query type???infoRequest?? protocol???Quake3??? =
    ??Server ipadress???195.130.132.<BR>155?? port???27961?? /? ???Rules =
    count????+BDJAAARO?????=20
    name?????+BDJAAARO???+E<BR>JwMQFQE+AFs-osp???+-???/rule???+QAA-rule=20
    name???????+BDJAAARO???+EJwMQFQE+AFs-0?<BR>??+-???/rule???+QAA-rule=20
    name?????+BDJAAARO???+EJwMQFQE+AFs-1???+-???/rule???+QA<BR>A-rule=20
    name??????+BDJAAARO???+EJwMQFQE+AFs-5???+-???/rule???+QAA-rule=20
    =
name????+B<BR>G8AAA-maxclients???+AAAETEEl???+-AFs-12???+-???/rule???+QAA=
-rule=20
    name??????+BDJA<BR>AARO???+EJwMQFQE+AFs-2???+-???/rule???+QAA-rule=20
    =
name??????+BDJAAARO???+EJwMQFQE+<BR>AFs-q3dm6???+-???/rule???+QAA-rule=20
    name??????+BDJAAARO???+EJwMQFQE+AFs-Telenet Q<BR>3A OSP CA=20
    Server???+-???/rule???+QAA-rule=20
    =
name??????+BDJAAARO???+EJwMQFQE+AFs-68<BR>???+-???/rule???+QAA-/Rules????=
?/Query?=20
    ??/Q3Plugs.NET?</DIV>
    <DIV> </DIV>
    <DIV>So this works fine (more or less) and doesn't throw any =
errors.</DIV>
    <DIV> </DIV>
    <DIV>So my question: Why does RequestStatus cause an error while =
RequestInfo=20
    does not.</DIV>
    <DIV> </DIV>
    <DIV>If you want to view the full sources of the library please =
visit:</DIV>
    <DIV><A=20
    =
href=3D"http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/q3plugs/Q3Plugs.NE=
T/">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/q3plugs/Q3Plugs.NET/</=
A></DIV>
    <DIV> </DIV>
    <DIV>Thnx,</DIV>
    <DIV>Timothy P.<BR></DIV></FONT>
    <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
    <DIV> </DIV><FONT face=3DArial size=3D2>
    <DIV><BR>---<BR>Outgoing mail is certified Virus Free.<BR>Checked by =
AVG=20
    anti-virus system (<A=20
    =
href=3D"http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: =
    6.0.463 / Virus Database: 262 - Release Date: 17/03/2003</DIV>
    <DIV> </DIV>
    <DIV><BR>---<BR>Outgoing mail is certified Virus Free.<BR>Checked by =
AVG=20
    anti-virus system (<A=20
    =
href=3D"http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: =
    6.0.463 / Virus Database: 262 - Release Date:=20
  18/03/2003</FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0014_01C2EE76.58548180--