[Mono-devel-list] RE: Mono-devel-list digest, Vol 1 #576 - 12 msgs
claes
claes at xvalue.net
Thu Feb 26 04:00:54 EST 2004
First time for me to reply to the list....n' I hope this is the right
way!
REF: "11. Re: mod-mono-server Error || Http 500 (Jaroslaw Kowalski)"
Problem:
One problem is that the server you are spawning overrides your chmod 777
command -- a race condition where your mother process win.
Workaround:
I would suggest putting a sleep before you change access mode (chmod
777) to the pipe.
...
mono $MOD_MONO_SERVER --applications /:/home/html --nonstop > /dev/null
&
ret=$?
if [ $ret -eq 0 ]; then
sleep 3
chmod 777 $MOD_MONO_PIPE
echo_success
# /sbin/service apache2 restart
else
...
Note. I ran the script on my box and it went OK after I altered it with
the sleep line. Also, I don't use the "/sbin/service apache2 restart"
line.
Hope this helps
Claes
-----Original Message-----
From: mono-devel-list-admin at lists.ximian.com
[mailto:mono-devel-list-admin at lists.ximian.com] On Behalf Of
mono-devel-list-request at lists.ximian.com
Sent: Thursday, February 26, 2004 16:39
To: mono-devel-list at lists.ximian.com
Subject: Mono-devel-list digest, Vol 1 #576 - 12 msgs
Send Mono-devel-list mailing list submissions to
mono-devel-list at lists.ximian.com
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.ximian.com/mailman/listinfo/mono-devel-list
or, via email, send a message with subject or body 'help' to
mono-devel-list-request at lists.ximian.com
You can reach the person managing the list at
mono-devel-list-admin at lists.ximian.com
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Mono-devel-list digest..."
Today's Topics:
1. RE: compile error on cygwin since yesterd (Urs Muff)
2. Re: String::GetHashCode speedup (Miguel de Icaza)
3. Re: Inefficiencies in mcs (Andreas Nahr)
4. Re: Problems with System.Drawing (Jordi Mas)
5. Re: Problems with System.Drawing (Chris Seaton)
6. First (near) completed assembly and Locales (Andreas Nahr)
7. monodoc advice (Philip)
8. Re: Problems with System.Drawing (Duncan Mak)
9. XmlTextReader (Janus N. =?ISO-8859-1?Q?T=F8ndering?=)
10. mod-mono-server Error || Http 500 (Met @ Uber)
11. Re: mod-mono-server Error || Http 500 (Jaroslaw Kowalski)
12. Re: XmlTextReader (Atsushi Eno)
--__--__--
Message: 1
From: Urs Muff <umuff at QUARK.com>
To: 'Varga Zoltan' <vargaz at freemail.hu>
Cc: mono-devel-list at lists.ximian.com
Subject: RE: [Mono-devel-list] compile error on cygwin since yesterd
Date: Wed, 25 Feb 2004 07:42:08 -0700
I'm using the mono/web/mono-build-w32.sh script.
This is doing a cvs update, autogen.sh and ./configure, before building
every time.
You did the change and broke the build, it worked fine before --> I'm
doing
a build every day!
...
Making all in interpreter
make[3]: Entering directory
`/cygdrive/d/CVS-Repositories/go-mono.com/mono/mono/interpreter'
/bin/bash ../../libtool --mode=link gcc -mno-cygwin -O -I
/cygdrive/d/CVS-Repositories/go-mono.com/install/include -I
/cygdrive/d/CVS-Repositories/go-mono.com/install/icu/include
-fno-strict-aliasing -g -Wall -Wunused -Wmissing-prototypes
-Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes
-Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align
-Wwrite-strings
-L/cygdrive/d/CVS-Repositories/go-mono.com/install/lib
-L/cygdrive/d/CVS-Repositories/go-mono.com/
install/icu/lib -o mint.exe main.o libmint.la -lws2_32 -lpsapi
gcc -mno-cygwin -O -I
/cygdrive/d/CVS-Repositories/go-mono.com/install/include -I
/cygdrive/d/CVS-Repositories/go-mono.com/install/icu/include
-fno-strict-aliasing -g -Wall -Wunused -Wmissing-prototypes
-Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes
-Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align
-Wwrite-strings
-o mint.exe main.o
-L/cygdrive/d/CVS-Repositories/go-mono.com/install/lib
-L/cygdrive/d/CVS-Repositories/go-mono.com/install/icu/lib
./.libs/libmint.a
-lgc -lgthread-2.0 -lgmodule-2.0 -lglib-2.0 /usr/lib/libintl.dll.a
-L/usr/lib /usr/lib/libiconv.dll.a -L/usr/local/icu/lib -licuuc -licuin
-lws2_32 -lpsapi
./.libs/libmint.a(gc.o)(.text+0xde0): In function `mono_gc_disable':
/cygdrive/d/CVS-Repositories/go-mono.com/mono/mono/metadata/gc.c:664:
undefined reference to `_GC_disable'
./.libs/libmint.a(gc.o)(.text+0xdef): In function `mono_gc_enable':
/cygdrive/d/CVS-Repositories/go-mono.com/mono/mono/metadata/gc.c:670:
undefined reference to `_GC_enable'
collect2: ld returned 1 exit status
make[3]: *** [mint.exe] Error 1
make[3]: Leaving directory
`/cygdrive/d/CVS-Repositories/go-mono.com/mono/mono/interpreter'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/cygdrive/d/CVS-Repositories/go-mono.com/mono/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/cygdrive/d/CVS-Repositories/go-mono.com/mono'
make: *** [all] Error 2
- Urs
-----Original Message-----
From: Varga Zoltan [mailto:vargaz at freemail.hu]
Sent: Wednesday, February 25, 2004 7:15 AM
To: umuff at QUARK.com
Subject: RE: [Mono-devel-list] compile error on cygwin since yesterd
Hi,
I couldn't reproduce this. GC_enable and GC_disable should
be in the
same library as GC_malloc, which is found. What version of
Boehm GC
are you using ? Also, what is the value of the --with-gc=
argument to
configure ? Also, could you check whenever there where are
compiler
warnings while compiling metadata/gc.c ?
thanks
Zoltan
--__--__--
Message: 2
Subject: Re: [Mono-devel-list] String::GetHashCode speedup
From: Miguel de Icaza <miguel at ximian.com>
To: Ben Maurer <bmaurer at users.sourceforge.net>
Cc: Mono Development <mono-devel-list at lists.ximian.com>
Date: Wed, 25 Feb 2004 11:00:43 -0500
Hello,
> > Until that happens, it does not make sense to go to the managed
> > version. It is a change that just changes the conditions to
something
> > that looks better in this particular benchmark.
> Well, the idea is that you are going to get the hashcode on small
> strings more often than on large strings, so you still get a net
> benefit.
>
> For example, if I remember correctly from when I was optimizing MCS, a
> large percent of our calls to Hashtable are looking up local
variables.
> I know that coding conventions are in dispute, but I doubt we are
> looking up many 30 some char variable names.
Dear dude, please do a poll of all the string lengths used in the world
before your patch changes the direction.
--__--__--
Message: 3
From: "Andreas Nahr" <ClassDevelopment at A-SoftTech.com>
To: "Rodrigo B. de Oliveira" <rbo at acm.org>,
"Mono-Devel-List" <mono-devel-list at lists.ximian.com>
Subject: Re: [Mono-devel-list] Inefficiencies in mcs
Date: Wed, 25 Feb 2004 19:38:03 +0100
Organization: A - Soft Technologies
>
> > Hi,
> >
> > ...
> > L_0061:
> > return num1;
> > }
> >
> > Which intoduces an excess variable of type int and handles all
return
> cases
> > at the end instead of immediately doing an constant int - return
(which
> > should be faster)
> >
>
> it should, shouldn't it? But does it?
>
> I'm writing a compiler and my earlier tests showed me that code like
that
> can
> in fact run faster sometimes... Time it. I'd be curious to know what
you
> come up with.
OK - took the time to time it. (using Mono .30 on Windows)
Here are the results:
Direct return: 28621
Indirect : 29061
Second try (Testcode modified to leave on another branch):
Direct return: 28601
Indirect : 29022
The results are probably correct to +/- 20ms
Interrestingly on MS.Net the speed seems equal within the +/- 20ms
So my assumptions seem to be right.
The immediate return seems faster (although the difference obviously
isn't
that big)
Andreas
--__--__--
Message: 4
Date: Wed, 25 Feb 2004 19:42:11 +0100
From: Jordi Mas <jordi at ximian.com>
To: Chris Seaton <chris at chrisseaton.com>
Cc: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-devel-list] Problems with System.Drawing
En/na Chris Seaton ha escrit:
Hello Cris,
In order to use System.Drawing you need to have installed libgdiplus.so.
You
can find a recent built version at http://www.go-mono.com/download.html.
A part of that, the imaging part is not yet completed, some
functionality may
be not there yet.
Jordi,
> Does nobody have any ideas?
>
> I installed from Fedora Core 1 RPMs, so I would imagine other people
> with a similar setup might experience this problem?
>
> Can someone please at least acknowledge my question?
>
> Chris Seaton
>
> Chris Seaton wrote:
>
>> I'm using System.Drawing to make thumbnails of images. I can
reference
>> the assembly System.Drawing but when I use anything in it I get the
error
>>
>> ** (bin/Club.exe:10139): WARNING **: Failed to load library
>> ./libgdiplus.dll.so (gdiplus.dll): ./libgdiplus.dll.so: cannot open
>> shared object file: No such file or directory
>>
>> libgdiplus.dll.so is located in /usr/local/lib, where I would expect
>> it to be. Why isn't Mono finding it?
>>
>> I'm curious as to why it is looking for "./libgdiplus.dll.so", and
not
>> just "libgdiplus.dll.so". Is that the problem?
>>
>> I'm pretty sure this is a setup issue as I can't find more than one
>> other reference to this problem (there was no solution given).
>>
>> Thanks,
>>
>> Chris Seaton
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
--__--__--
Message: 5
Date: Wed, 25 Feb 2004 19:08:18 +0000
From: Chris Seaton <chris at chrisseaton.com>
To: Jordi Mas <jordi at ximian.com>
Cc: mono-devel-list at lists.ximian.com
Subject: Re: [Mono-devel-list] Problems with System.Drawing
> In order to use System.Drawing you need to have installed
libgdiplus.so.
> You can find a recent built version at
> http://www.go-mono.com/download.html.
>
> A part of that, the imaging part is not yet completed, some
> functionality may be not there yet.
>
> Jordi,
Yeah, I have libgdiplus.so.0. It's in /usr/lib. It's version 0.1,
installed from the Fedora Core 1 RPM.
The problem is that Mono can't load the library "./libgdiplus.dll.so",
it says that there is no such file or directory. The reasons that it
can't find that file is that it doesn't exist in the current directory
"./". Why is Mono looking there, and how can I make it look in the usual
places (/usr/local/lib)?
Thanks,
Chris Seaton
--__--__--
Message: 6
From: "Andreas Nahr" <ClassDevelopment at A-SoftTech.com>
To: "Mono-Devel-List" <mono-devel-list at lists.ximian.com>
Date: Wed, 25 Feb 2004 20:14:58 +0100
Organization: A - Soft Technologies
Subject: [Mono-devel-list] First (near) completed assembly and Locales
This is a multi-part message in MIME format.
------=_NextPart_000_0035_01C3FBDC.0A714C40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Hi,
I just wanted to say that with System.Drawing.Design the first assembly
is
(functionally) complete ;)
Ok - one thing is missing: The Locale class (I've been working with
Miguel
and others on a concept a while back), so attached is a suggestion for
this
class.
Please comment and make suggestions for improvements!
Andreas
------=_NextPart_000_0035_01C3FBDC.0A714C40
Content-Type: text/plain;
name="Locale.cs"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="Locale.cs"
//
// Locale.cs
//
// Author:
// Andreas Nahr (ClassDevelopment at A-SoftTech.com)
// Miguel de Icaza (miguel at ximian.com)
//
// (C) 2001 - 2003 Ximian, Inc (http://www.ximian.com)
//
using System;
using System.Globalization;
using System.Resources;
using System.Reflection;
internal sealed class Locale
{
private static CultureInfo currentCulture;
private static String neutralLangID;
private static bool useInternal;
private static ResourceManager rm;
private static ResourceSet currentResources;
static Locale ()
{
object[] attribs =3D
Assembly.GetCallingAssembly().GetCustomAttributes =
(
typeof (NeutralResourcesLanguageAttribute),
false);
if (attribs.Length >=3D 1)
neutralLangID =3D =
((NeutralResourcesLanguageAttribute)attribs[0]).CultureName;
rm =3D new ResourceManager ("Resources", =
Assembly.GetCallingAssembly());
InitCulture();
}
private Locale ()
{
}
private static void InitCulture ()
{
currentCulture =3D CultureInfo.CurrentUICulture;
// Check if we are using the neutral culture
if (neutralLangID =3D=3D currentCulture.Name) {
useInternal =3D true;
currentResources =3D null;
return;
}
// Check if other resources exist
currentResources =3D rm.GetResourceSet (currentCulture,
true, true);
if (currentResources =3D=3D null) {
useInternal =3D true;
return;
}
useInternal =3D false;
}
/// <summary>
/// Returns the translated message for the current locale
/// </summary>
internal static string GetText (string msg)
{
// Check if the culture has changed
if (CultureInfo.CurrentUICulture !=3D currentCulture)
// TODO locking mechanism here?
InitCulture();
if (useInternal)
return msg;
// TODO Is it guaranteed that we get something back
here?
return currentResources.GetString (msg);
}
internal static object GetObject (string idString)
{
return rm.GetObject (idString);
}
}
------=_NextPart_000_0035_01C3FBDC.0A714C40--
--__--__--
Message: 7
From: Philip <phil at noggle.biz>
To: Mono-devel-list <Mono-devel-list at lists.ximian.com>
Date: Wed, 25 Feb 2004 15:04:30 -0500
Subject: [Mono-devel-list] monodoc advice
Hello,
I'm using monodoc to build some docs for a project and had a few
questions. First monodoc has been integrated into our build system,
integration was easy and the docs look great. Once the docs are built
(make doc) they're exported to the sources directory where they can be
viewed with the browser. I want to be able to sync any docs generated
from future code changes, and documentation written through the browser.
Do I have to do anything special here to prevent anything from being
lost?
Second, I'm getting errors in the browser when viewing my name spaces.
The classes view with the "Type" and "Summary" headings show up fine
with the Type field populated with my class names and the Summary field
containing the "to be added" tag and "An error occured while loading
type information: File "My.Namespace" not found. I'm not really sure
where to start tracking this one down. Any help would be great.
Thanks,
- Phil
ps Monodoc is one of the most useful tools yet, it's getting me out of
writing A LOT of documentation for my senior design project. Less
writing is good.
--__--__--
Message: 8
Subject: Re: [Mono-devel-list] Problems with System.Drawing
From: Duncan Mak <duncan at ximian.com>
To: Chris Seaton <chris at chrisseaton.com>
Cc: Jordi Mas <jordi at ximian.com>,
mono-devel mailing list <mono-devel-list at lists.ximian.com>
Date: Wed, 25 Feb 2004 18:17:11 -0500
Hello Chris,
On Wed, 2004-02-25 at 14:08, Chris Seaton wrote:
> Yeah, I have libgdiplus.so.0. It's in /usr/lib. It's version 0.1,
> installed from the Fedora Core 1 RPM.
Do you have libgdiplus-devel installed as well?
> The problem is that Mono can't load the library "./libgdiplus.dll.so",
> it says that there is no such file or directory. The reasons that it
> can't find that file is that it doesn't exist in the current directory
> "./". Why is Mono looking there, and how can I make it look in the
usual
> places (/usr/local/lib)?
The library should be in the same prefix as where Mono is installed. If
your mono is installed from RPM (in /usr), then libgdiplus should also
be in /usr.
Hope this helps,
Duncan.
--__--__--
Message: 9
From: "Janus N." =?ISO-8859-1?Q?T=F8ndering?= <janus at bananus.dk>
To: mono-devel-list at lists.ximian.com
Date: Thu, 26 Feb 2004 01:39:06 +0100
Subject: [Mono-devel-list] XmlTextReader
Hi,
I am working on a Jabber client for GTK/GNOME and I decided to use
Mono/C# as the development platform. I am not experienced with either.
I have run into some problems with XmlTextReader. I am sending a
"<iq...>...</iq>" message and I am waiting for the response. No matter
what Read method I use it won't return the data received before the
connection times out and the server sends an error message. I used
tcpdump to verify that the answer actually arrives.
I am aware that XmlTextReader does buffering but shouldn't it return
data as soon as it is available? Is there anything special I should be
aware of?=20
If needed, I can post the code in question.
Any help is appreciated.
Regards,
Janus N. T=F8ndering
--=20
Janus N. T=F8ndering <janus at bananus.dk>
GPG Fingerprint: 4035 778C 4868 25C6 D23E 175A 8593 AEFF 7145 2196
--__--__--
Message: 10
From: "Met @ Uber" <met at uberstats.com>
To: Mono-devel <mono-devel-list at lists.ximian.com>
Organization: Uberstats
Date: Wed, 25 Feb 2004 21:29:15 -0500
Subject: [Mono-devel-list] mod-mono-server Error || Http 500
--=-j8Lbn2NVPZJRl1LIbFo1
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
When launching mod-mono-server.exe via the command line, and then
restart/starting the apache2 web server EVERYTHING seems to work fine.
But when I use a bash script I've used by putting together other scripts
(thanks Jaroslaw), I get a Server error about not being able to find a
file. Below is the full error from the browser, and my bash script is
attached.
As always, any help would be greatly appreciated.
~ Matthew
====
Description: Error processing request.
Error Message: HTTP 500.
Stack Trace:
System.ComponentModel.Win32Exception: Cannot find the specified file
in <0x00310> System.Diagnostics.Process:Start_common
(System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process)
in <0x00016> System.Diagnostics.Process:Start ()
in <0x0005d> (wrapper remoting-invoke-with-check)
System.Diagnostics.Process:Start ()
in <0x00204> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromFileBatch
(System.CodeDom.Compiler.CompilerParameters,string[],bool)
in <0x00326> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDomBatch
(System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUn
it[])
in <0x00060> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDom
(System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUn
it)
in <0x00133> System.Web.Compilation.CachingCompiler:Compile
(System.Web.Compilation.BaseCompiler)
in <0x00263> System.Web.Compilation.BaseCompiler:GetCompiledType ()
in <0x001de> System.Web.Compilation.AspGenerator:GetCompiledType ()
in <0x00049>
System.Web.Compilation.GlobalAsaxCompiler:CompileApplicationType
(System.Web.UI.ApplicationFileParser)
in <0x0003b>
System.Web.UI.ApplicationFileParser:GetCompiledApplicationType
(string,System.Web.HttpContext)
in <0x00045> System.Web.HttpApplicationFactory:CompileApp
(System.Web.HttpContext)
in <0x00032> System.Web.HttpApplicationFactory:InitializeFactory
(System.Web.HttpContext)
in <0x0009e> System.Web.HttpApplicationFactory:GetInstance
(System.Web.HttpContext)
in <0x0012d> System.Web.HttpRuntime:InternalExecuteRequest
(System.Web.HttpWorkerRequest
====
--=-j8Lbn2NVPZJRl1LIbFo1
Content-Disposition: attachment; filename=asp.net
Content-Type: text/x-sh; name=asp.net; charset=UTF-8
Content-Transfer-Encoding: 7bit
#! /bin/bash
#
# description: Provides ASP.NET functionality for Apache
#
# Source function library.
INITD=/etc/rc.d/init.d
. $INITD/functions
MOD_MONO_SERVER="/usr/local/bin/mod-mono-server.exe"
MOD_MONO_PIPE="/tmp/mod_mono_server"
start() {
echo -n "Starting ASP.NET..."
if [ -z "$PIDS" ]; then
mono $MOD_MONO_SERVER --applications /:/home/html --nonstop >
/dev/null &
ret=$?
if [ $ret -eq 0 ]; then
chmod 777 $MOD_MONO_PIPE
echo_success
/sbin/service apache2 restart
else
echo_failure
fi
else
echo ASP.NET already running. PIDs: $PIDS
fi
echo
}
stop() {
echo -n "Stopping ASP.NET..."
if [ -z "$PIDS" ]; then
echo ASP.NET is not running.
else
kill -9 $PIDS 2> /dev/null
ret=$?
if [ $ret -eq 0 ]; then
echo_success
else
echo_failure
fi
fi
echo
}
restart() {
$0 stop
$0 start
}
PIDS=`ps awx | grep mod-mono-server | grep -v grep | cut -b 1-5`;
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
--=-j8Lbn2NVPZJRl1LIbFo1--
--__--__--
Message: 11
From: "Jaroslaw Kowalski" <jaak at zd.com.pl>
To: "Met @ Uber" <met at uberstats.com>,
"Mono-devel" <mono-devel-list at lists.ximian.com>
Subject: Re: [Mono-devel-list] mod-mono-server Error || Http 500
Date: Thu, 26 Feb 2004 08:31:38 +0100
Make sure "mcs" is in your PATH in the environment of
"mod-mono-server.exe"
Jarek
----- Original Message -----
From: "Met @ Uber" <met at uberstats.com>
To: "Mono-devel" <mono-devel-list at lists.ximian.com>
Sent: Thursday, February 26, 2004 3:29 AM
Subject: [Mono-devel-list] mod-mono-server Error || Http 500
> When launching mod-mono-server.exe via the command line, and then
> restart/starting the apache2 web server EVERYTHING seems to work fine.
> But when I use a bash script I've used by putting together other
scripts
> (thanks Jaroslaw), I get a Server error about not being able to find a
> file. Below is the full error from the browser, and my bash script is
> attached.
>
> As always, any help would be greatly appreciated.
>
> ~ Matthew
>
> ====
>
> Description: Error processing request.
>
> Error Message: HTTP 500.
>
> Stack Trace:
>
> System.ComponentModel.Win32Exception: Cannot find the specified file
> in <0x00310> System.Diagnostics.Process:Start_common
(System.Diagnostics.ProcessStartInfo,System.Diagnostics.Process)
> in <0x00016> System.Diagnostics.Process:Start ()
> in <0x0005d> (wrapper remoting-invoke-with-check)
System.Diagnostics.Process:Start ()
> in <0x00204>
Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromFileBatch
(System.CodeDom.Compiler.CompilerParameters,string[],bool)
> in <0x00326>
Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDomBatch
(System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUn
it[]
)
> in <0x00060> Mono.CSharp.CSharpCodeCompiler:CompileAssemblyFromDom
(System.CodeDom.Compiler.CompilerParameters,System.CodeDom.CodeCompileUn
it)
> in <0x00133> System.Web.Compilation.CachingCompiler:Compile
(System.Web.Compilation.BaseCompiler)
> in <0x00263> System.Web.Compilation.BaseCompiler:GetCompiledType ()
> in <0x001de> System.Web.Compilation.AspGenerator:GetCompiledType ()
> in <0x00049>
System.Web.Compilation.GlobalAsaxCompiler:CompileApplicationType
(System.Web.UI.ApplicationFileParser)
> in <0x0003b>
System.Web.UI.ApplicationFileParser:GetCompiledApplicationType
(string,System.Web.HttpContext)
> in <0x00045> System.Web.HttpApplicationFactory:CompileApp
(System.Web.HttpContext)
> in <0x00032> System.Web.HttpApplicationFactory:InitializeFactory
(System.Web.HttpContext)
> in <0x0009e> System.Web.HttpApplicationFactory:GetInstance
(System.Web.HttpContext)
> in <0x0012d> System.Web.HttpRuntime:InternalExecuteRequest
(System.Web.HttpWorkerRequest
>
> ====
>
--__--__--
Message: 12
Date: Thu, 26 Feb 2004 16:38:14 +0900
From: Atsushi Eno <atsushi at ximian.com>
Subject: Re: [Mono-devel-list] XmlTextReader
To: =?ISO-8859-15?Q?=22=5C=22Janus_N=2E=5C=22_T=F8ndering=22?=
<janus at bananus.dk>
Cc: mono-devel-list at lists.ximian.com
This is a multi-part message in MIME format.
--Boundary_(ID_KybR5ZjeRjPqVo9GUKFF2Q)
Content-type: text/plain; format=flowed; charset=ISO-8859-15
Content-transfer-encoding: 8BIT
Hello,
Before I changed XmlTextReader design to hold internal cache and
read the stream in advance, I tested how MS.NET(1.1) did buffering.
When you ran attached example (which uses StreamReader wrapper and
wrapped WebClient stream in such way), you will find XmlTextReader
reading the stream regardless of its markup (note that first Read()
fills the buffer up to 4096 and they never calls Read()).
If you have existing code that ran successfully under MS.NET,
please post it, and then I can review it.
BTW, if you want to get remaining stream, you can use GetRemainder().
Thanks,
Atsushi Eno
Janus N. Tondering wrote:
> Hi,
>
> I am working on a Jabber client for GTK/GNOME and I decided to use
> Mono/C# as the development platform. I am not experienced with either.
>
> I have run into some problems with XmlTextReader. I am sending a
> "<iq...>...</iq>" message and I am waiting for the response. No matter
> what Read method I use it won't return the data received before the
> connection times out and the server sends an error message. I used
> tcpdump to verify that the answer actually arrives.
>
> I am aware that XmlTextReader does buffering but shouldn't it return
> data as soon as it is available? Is there anything special I should be
> aware of?
>
> If needed, I can post the code in question.
> Any help is appreciated.
>
> Regards,
> Janus N. Tondering
>
--Boundary_(ID_KybR5ZjeRjPqVo9GUKFF2Q)
Content-type: text/plain; name=xtrstream.cs
Content-disposition: inline; filename=xtrstream.cs
Content-transfer-encoding: 7BIT
using System;
using System.IO;
using System.Collections;
using System.Xml;
public class MyStringReader : StringReader
{
public MyStringReader (string s) : base (s) {}
public override int Read ()
{
Console.WriteLine ("****Read called****");
return base.Read ();
}
public override int Read (char [] buffer, int index, int count)
{
Console.WriteLine ("****Read called: buffer size {0},
index {1} count {2}", buffer.Length, index, count);
return base.Read (buffer, index, count);
}
public override int ReadBlock (char [] buffer, int index, int
count)
{
Console.WriteLine ("****ReadBlock called****");
return base.ReadBlock (buffer, index, count);
}
public override string ReadLine ()
{
Console.WriteLine ("****ReadLine called****");
return base.ReadLine ();
}
public override string ReadToEnd ()
{
Console.WriteLine ("****ReadToEnd called****");
return base.ReadToEnd ();
}
}
public class MyStreamReader : TextReader
{
StreamReader r;
public MyStreamReader (StreamReader r)
{
this.r = r;
}
public override int Read ()
{
Console.WriteLine ("****Read called****");
return r.Read ();
}
public override int Read (char [] buffer, int index, int count)
{
Console.WriteLine ("****Read called: buffer size {0},
index {1} count {2}", buffer.Length, index, count);
return r.Read (buffer, index, count);
}
public override int ReadBlock (char [] buffer, int index, int
count)
{
Console.WriteLine ("****ReadBlock called****");
return r.ReadBlock (buffer, index, count);
}
public override string ReadLine ()
{
Console.WriteLine ("****ReadLine called****");
return r.ReadLine ();
}
public override string ReadToEnd ()
{
Console.WriteLine ("****ReadToEnd called****");
return r.ReadToEnd ();
}
}
public class MyClass
{
public static void Main()
{
try {
Run ();
} catch (Exception ex) {
Console.WriteLine (ex);
}
}
static void Run ()
{
// MyStringReader sr = new MyStringReader ("<root
attr='attr1 &ent; value'><testchild>test content string <![CDATA[ cdata
included ]]></testchild></root>");
MyStreamReader sr = new MyStreamReader (
new StreamReader (new System.Net.WebClient
().OpenRead ("http://www.w3.org/2001/XMLSchema.xsd")));
XmlTextReader xtr = new XmlTextReader (sr);
xtr.XmlResolver = null;
while (!xtr.EOF) {
xtr.Read ();
Console.WriteLine (xtr.ReadOuterXml ());
}
}
private static void WL(string text, params object[] args)
{
Console.WriteLine(text, args);
}
private static void RL()
{
Console.ReadLine();
}
private static void Break()
{
System.Diagnostics.Debugger.Break();
}
}
--Boundary_(ID_KybR5ZjeRjPqVo9GUKFF2Q)--
--__--__--
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
End of Mono-devel-list Digest
More information about the Mono-devel-list
mailing list