Permalink
Browse files

C# statsd FileShare mode now ReadWrite, so more than one process can …

…access the MailSlot
  • Loading branch information...
1 parent 1c7f438 commit 8f98e93338482672ec478778ed67714974a983e5 yangming committed Sep 25, 2012
View
Binary file not shown.
@@ -72,7 +72,11 @@ protected void AddMessage(String message)
{
if (message != null && !message.Equals(""))
{
- this.msgSet.Add(message);
+ string[] submsgs = message.Split('|');
+ foreach (string sub in submsgs)
+ {
+ this.msgSet.Add(sub);
+ }
}
}
@@ -64,7 +64,7 @@ private FileStream mailSlot
{
slotHandle = NativeMailSlot.CreateFile(SLOTNAME,
(uint)FileAccess.Write,
- (uint)FileShare.Read,
+ (uint)FileShare.ReadWrite,
0,
(uint)FileMode.Open,
(uint)FileAttributes.Normal,
@@ -115,7 +115,7 @@ public bool Send(string mail)
#region IDisposable Members
- public void Dispose()
+ public void Close()
{
if (fs != null)
{
@@ -128,6 +128,11 @@ public void Dispose()
}
}
+ public void Dispose()
+ {
+ this.Close();
+ }
+
#endregion
}
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.1.1")]
+[assembly: AssemblyVersion("1.0.1.2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -131,16 +131,16 @@ static void TestMailSlotStreaming()
static void ShowExample(IStatsdClient statsd)
{
statsd.Gauge(bucketPrefix + "gauge", 500);
- statsd.Gauge("Gauge(string message, string key, int value)", bucketPrefix + "gauge", 500);
+ statsd.Gauge("test|Gauge(string message, string key, int value)", bucketPrefix + "gauge", 500);
statsd.Timing(bucketPrefix + "timer", 500);
- statsd.Timing("Timer(string message, string key, int value)", bucketPrefix + "timer", 500);
+ statsd.Timing("test|Timer(string message, string key, int value)", bucketPrefix + "timer", 500);
statsd.Increment(bucketPrefix + "counter");
statsd.Decrement(bucketPrefix + "counter");
statsd.UpdateCount(2, bucketPrefix + "counter");
statsd.UpdateCount(3, 0, bucketPrefix + "counter", bucketPrefix + "counter2");
statsd.UpdateCount(4, 2, bucketPrefix + "counter", bucketPrefix + "counter2");
- statsd.UpdateCount("UpdateCount(string message, string key, int value)", 5, bucketPrefix + "counter", bucketPrefix + "counter2");
- statsd.UpdateCount("UpdateCount(string message, string key, int value)", 6, 1, bucketPrefix + "counter");
+ statsd.UpdateCount("test|UpdateCount(string message, string key, int value)", 5, bucketPrefix + "counter", bucketPrefix + "counter2");
+ statsd.UpdateCount("UpdateCount(string message, string key, int value)|test", 6, 1, bucketPrefix + "counter");
}
static void TestBasic()

0 comments on commit 8f98e93

Please sign in to comment.