Showing posts from May, 2009

WCF - inheriting from a common interface

At work I have a few dozen (and will at some point get to hundreds) workflows with the same structure:

[XmlSerializerFormat]  [ServiceContract(Namespace = "")]  publicinterface IBasicContract<TRequest, TResponse>    where TRequest : class  where TResponse : class{    [XmlSerializerFormat]    [OperationContract(Name = "GetReport",      Action = "",      ReplyAction = "")]    [ServiceKnownType(typeof (Aggregate))]    TResponse GetReport(TRequest inquiry);    [XmlSerializerFormat]    [OperationContract(Name = "GetRawReport",      Action = "",      ReplyAction = "")]  string GetRawReport(string guid);    [XmlSerializerFormat]    [OperationContract(Name = "GetArchiveReport",   …

Multi-threaded server

This is a reply to this question on stackoverflow.

Many people "feel" that allocating a thread per socket is a bad idea. This might be true for 10,000 sockets, I don't know; however, for 300 threads which are idle most of the time, this is really not an issue - and hasn't been in Windows since at least Windows 2000.

Here's how this would look on my system:

I am going to put the code in the answer to the stackoverflow question; this is just a placeholder for the above image, mostly :)