This function will only throw an exception if some other thread besides the
current thread currently owns the lock. The owning thread can re-acquire the
lock as often as it wishes (but needs to match acquisition with Exit()
calls). I don't think that's what you intended, is it?
Regards, Bob
Thanks Mattias -- you make a pretty strong case for option C, but I'm just not sure
I'll feel 100% comfortable until somebody actually calls RegOpenKey on an IA64
machine, for me. ;)
-S
On Wed, 2 Apr 2003 20:59:56 +0200, Mattias =?iso-8859-1?Q?Sj=F6gren?= <[EMAIL
PROTECTED]> wrote:
>Shawn,
>
>I would think that b (0x8001) would be the correct answer
>because it seems that the High bit is set, not the 32nd bit, which is
There is a certain logical elegance to that argument -- but I hope that's not it,
because it would be a royal pita to construct properly in C#.
>Another q
> static void AssertIsLocked(object o) {
> if (Monitor.TryEnter(o))
> throw new ProgrammerNegligentException();
> }
The problem with this is that TryEnter will succeed regardless whether
the thread currently owns the lock on o. It will only fail if *another*
thread owns th
OUCH!
That hurt :)
I thing I'll have to take back my words that "I checked everywhere..."
Thanks very much for the help!
Kamen
-Original Message-
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Steve Johnson
Sent: 02 Април 2003 г. 19:46
To: [E
Will Convert.ToBase64String(byte[]) do what you need?
-- Scott
-Original Message-
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of jeff Hughes
Sent: Tuesday, April 01, 2003 7:33 AM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] Base64 Encoding f
No. SqlConnection.Dispose() does NOT close the connection, just releases it
back to the pool. Calling Close() when pooling is enabled also does not
close the connection.
The opposite has been stated publicly a few times by various (otherwise
highly qualified) developers. Since it was contrary t
Shawn,
WinReg.h defines HKEY_CURRENT_USER as
(( HKEY ) (ULONG_PTR)((LONG)0x8001) )
And with _W64 defined, that expands to
((void*)(unsigned __int64)((long)0x8001))
Which of the following do we think this magic value might look like on IA64?
a. 0x8001
b. 0x800
static void AssertIsLocked(object o) {
if (Monitor.TryEnter(o))
throw new ProgrammerNegligentException();
}
Compiles in Outlook...
John
John St. Clair
Prosjekt- og teamleder
Reaktor AS
-Original Message-
From: Moderated discussion of advanced .NET topics.
[mailt
Both Close and Dispose give the connection back to the pool. The only
difference between them in the SqlClient provider is that Dispose also
sets the connection string to null.
Bob Beauchemin
http://staff.develop.com/bobb
-Original Message-
From: Matthew [mailto:[EMAIL PROTECTED]
Sent: T
If you define a web service param as byte[], it should be serialized as
base64. If you want to do it by hand, you can use a string parameter and
do Convert.ToBase64String() and Convert.FromBase64String().
Does that help?
> -Original Message-
> From: jeff Hughes [mailto:[EMAIL PROTECTED]
Rick,
I have a sample at [1] that does what you're looking to do. It uses proxies
to tweak the ObjRef. I also have another sample [2] that does it by
overriding CreateObjRef in MBRO. AFAIK, tweaking the TypeInfo in the ObjRef
is the way to accomplish what you're after. I've never experienced t
Use Monitor.Pulse(obj)
If the current thread does not have obj locked, you'll get a
SynchronizationLockException, which you can throw directly or
translate into ProgrammerNegligentException. ;)
> To avoid code bloat and performance hits, I want to avoid using the lock
> statement in SomePrivat
jeff Hughes [mailto:[EMAIL PROTECTED] wrote:
> How do I encode a binary object to base64 so I can pass it to
> an XML document.
Check out Convert.ToBase64String. It takes an array of bytes and, surprise,
converts it to a base64 string. On the flip side, there's FromBase64String
to convert back to
I would think that b (0x8001) would be the correct answer
because it seems that the High bit is set, not the 32nd bit, which is
why i think that in ia64, the high bit again will be set, not the 32
bit. I see no reason for backwards compatibility in that sense. Unless
of course MS decide
>> I recommend the following programming pattern when doing data
>> access: SqlConnection conn = new SqlConnection(blah blah); try {
>>// do whatever kind of data access you need here...
>> }
>> finally {
>>conn.Dispose();
>> }
I was under the impression that calling SqlConnection.Dispose(
Hi,
When GetType is called on a TransparentProxy, the CLR attempts to get the
real type of the object being proxied by calling
RemotingServices.GetType(TransparentProxy), loading assemblies as necessary.
In a normal remoting scenario where the implementation assembly is
unavailable, this will fail
I'm trying to access a .NET remoting web server from a client that needs to
go through an authenticating proxy server to access the internet. In doing
so, I get - error: (407) Proxy Authentication Required. In going through
the mailing lists, I found that version 1.0 of the Framework does not
suppo
What channel did you use? HTTP or TCP?
Thanks,
Sudhakar
We have a requirement to access remoted objects from a COM client (asp
application). We would like to use remoting framework over web services for
various reasons. We did a sample implementation by using soapsuds to
create the client side proxy class and annotated this class with interop
attribute
Hi,
According to Ingo Rammer ("Advanced .Net remoting" page 106), the server
side HttpChannel automatically uses both soap and binary formatters and
detects which encoding has been chosen at the client side. I've never tried
this myself, but it should just work :)
Rick
-Original Message
Hi,
I had the same problems about a year ago. I was developing a .NET
Remoting project where over 200 computers were communicating with a
server. When I had to choose the technology very quickly I discovered
that I can make over 100 call per second if I am not using
authentication, but only about
http://dotnetweblogs.com/SAVanNess/posts/4019.aspx
It seems there's a bizarre bug, where you have to display the Properties window,
before .NET usercontrols will "stick" to the toolbox. I suspect the true cause of the
bug runs much deeper...?
-S
I have been trying to figure out how to transport binary data through Xml
to a web service that will upload this binary data to a sql server database.
I am able to do this if I connect directly to the database from my web app
and use executeNonQuery to send the binary data. What I am looking for i
> ...We are writing epos software for tills, so we want to prevent
> people from starting other packages.
Further to my original question, is there a better/simpler way to do what we are
trying to do? Or is there a method which is closer to the .NET way of doing things?
Thanks.
Michael
___
I've managed to manually fix the problem by specifying the machineName
property for the http channel in the config file. Still, I'm not really
happy with having to do it manually (or even doing it programatically) -
is there anyway to get remoting or IIS to simply use the same IP or
address as the
Ok, I finally managed to narrow this one down a bit.
Retrieving a reference to a well-known object hosted by IIS and calling
methods on it works fine. But as soon as it returns an object stuff
starts to go wrong. Using Ingo Rammer's hint at
http://www.ingorammer.com/RemotingFAQ/GETMARSHALBYREFOB
On Thu, 27 Mar 2003 17:11:33 -0500, Sudhakar <[EMAIL PROTECTED]> wrote:
>Can you please pass on the stack when the exception happens?
>Thanks, Sudhakar
Sudhakar,
please have a look at
http://home.hetnet.nl/~seeleboon/dotnet/ExceptionSerializationBug.html
for all information I have got on this subj
I'm p/invoking some registry functions, to get at some features not provided by
Microsoft.Win32.RegistryKey (like change-notification).
I'd like to learn how to properly construct the value of say, HKEY_CURRENT_USER, so
that my code will someday work correctly on both 32- and 64-bit systems.
Wi
Ranjan, if you completely separate your data access layer, you could wrap
your business access layer in a while loop. If you get one kind of error
(eg a blocking or other kind of "busy" error), the while loop continues, and
if you get something unexpected you will break out of the loop and you can
Hi ,
Thank for reply of Ayyappan Nair and Mark , it's very helpful ! ;>
And further,Ayyappan Nair ,I see my question in your code , could you
explain to me when could I open a connection . Can I open only one
connection before start my main form (I really want to do that !) and
close it when my
Michael,
This does the job, but after a varying number of keypresses - generally
over 90 and less than 200 - we get a null reference exception.
Most likely beacuse the callback delegate has been garbage collected. You
must hold a reference to it to keep it alive as long as the hook is active.
S
I am trying to do something pretty simple and can't find a way to do it.
Lets say I have objects that may be accessed from multiple threads. I
synchronize access to them using the C# lock statement, equvalent to calling
System.Threading.Monitor.Enter / Exit:
public void SomeHighLevelMethod() {
Seref,
I am one of the guys in the "I'm not the only one suffering..." group :))
There are two main reasons for the speed decrease: the overhead of the
authentication itself (which we can really do nothing about), and the very
stu... OK, inefficient manner in which IIS authenticates requests.
En
34 matches
Mail list logo