|
 |
 |
 |
|
Author: |
Travis Whidden |
Created: |
5/13/2007 9:53 PM |
 |
|
Ramblings from a computer nerd slash car guy. |
By Travis Whidden on
6/16/2009 6:05 PM
We have been diving deep into WCF lately. WCF is very nice to use, and a great alternative to web services. One of the things we are doing is dynamic WCF services where services can be created at run time of the web application (highly modified version of BinaryCoder's source listed on the MSDN website). Anyhow, we are making reference to WCF interfaces that are hosted via IIS, and not wanting to generate the dirty proxy code that you need to do with web services. This is a great snippet - the original is: http://blog.weminuche.net/ Our changes were to fit our design, which was a different constructor where we passed the URI of the service, and the receive message size because some of the data results that were passed back were larger then the default window.
/// <summary>
/// Generic Service Proxy for WCF - Connect to a URI/L with a type interface.
/// </summary>
/// <typeparam name="TInterface"></typeparam>
public class ServiceProxy<TInterface> : ClientBase<TInterface>, IDisposable where TInterface : class
{
#region Delegates
public delegate void ServiceProxyDelegate<T>(TInterface proxy);
#endregion
public ServiceProxy()
: base(typeof (TInterface).ToString())
{
}
/// <summary>
/// Pass the URI directly to the constructor.
/// </summary>
/// <param name="uri"></param>
public ServiceProxy(string uri)
: base(new BasicHttpBinding(){MaxReceivedMessageSize = int.MaxValue}, new EndpointAddress(uri))
{
}
public TInterface Proxy
{
get { return Channel; }
}
#region IDisposable Members
public void Dispose()
{
if (State == CommunicationState.Faulted)
{
base.Abort();
}
else
{
try
{
base.Close();
}
catch
{
base.Abort();
}
}
}
#endregion
protected override TInterface CreateChannel()
{
return base.CreateChannel();
}
public static void Call(ServiceProxyDelegate<TInterface> proxyDelegate)
{
Call(proxyDelegate, typeof (TInterface).ToString());
}
public static void Call(ServiceProxyDelegate<TInterface> proxyDelegate, string endpointConfigurationName)
{
var channel = new ChannelFactory<TInterface>(endpointConfigurationName);
try
{
proxyDelegate(channel.CreateChannel());
}
finally
{
if (channel.State == CommunicationState.Faulted)
{
channel.Abort();
}
else
{
try
{
channel.Close();
}
catch
{
channel.Abort();
}
}
}
}
}
Usage is very simple: using (var client = new ServiceProxy<IModuleServices>(someURI))
{
var md = client.Proxy.ModuleDetailsGet(packet.UserSession.SessionID, packet.ModuleInstalledID);
return md.ReturnValue;
}
|
By Travis Whidden on
5/14/2009 3:58 PM
This tutorial will show you how to accept multicast traffic on a specific adapter. Windows NT doesn't allow for Multicast traffic on a multi-homed system on all adapters - only the first one to boot. This is a problem for people who have applications that require multiple networks but need multicast on a specific network. In my field of work, this happens in surveillance systems where many NVR/DVR providers multicast packet delivery to hosts. The FASTEST way to get multicast traffic is to plug the Ethernet cable that will contain the multicast traffic into the first network adapter on your server. This tutorial is going to show you how to switch the boot priority of the Ethernet without the need to be onsite, without having to modify the registry manually, without having to use RAS (Routing and Remote Access). Open up your network connections. You should see something like this: Quick Command: Start->Run->ncpa.cpl Notice how my network named "Pelco" network was listed second. This is because someone plugged the cable into port 2 on the server. Unfortunately, Port 2 now is the adapter where multicast traffic will come from. To change the boot priority so that the "Pelco" network boots first, click on that "Advanced" tool bar option. (I know, I never noticed it there before ether). Click "Advanced Settings" Now, Change the Adapter and Bindings - the top most item boots first, and next down the line boots next: Now, I am not sure if its needed or not, but the boot priority seems like I would need to reboot it. Maybe they don't call it "boot priority" but, that's how I look at it. Once you reboot, you should now be getting Multi-cast traffic on that first adapter (well, 2nd adapter made to boot first). Happy Multi-casting!
|
By Travis Whidden on
12/29/2008 10:45 AM
Example of using the ContentControl - it squeezes the content down to its minimum size. I am sure there is a solution, just need to find out how/what

Note, this is just a tester app. I am using the Content Control dynamically in my real application.
|
By Travis Whidden - Family User on
9/9/2008 7:06 AM
We got a chance to fire a friends BMG 50 cal sniper rifle. What a gun. The concussion around us was amazing. However, there was a slight defect in the stock, and it was collapsing on us.. resulting in some damage to our faces :)
|
By Travis Whidden - Family User on
9/8/2008 8:01 AM
Yea, so last year we went shooting, and I got to fire my buddies 50 cal revolver. It was absolutely retarded, but the video is actually funny when you play it back at 1/4 speed. Almost hits me in the face.
|
By Travis Whidden on
8/23/2008 7:20 AM
wow.. just wow.
|
By Travis Whidden on
8/20/2008 6:46 AM
Just nuts.
|
By Travis Whidden on
8/13/2008 6:58 AM
Yea, ummm... I am down with this.  I just put in a Cisco 3640 router with several FastEthernet ports. Going to use my Cisco 806 at my office. I pay for the top tier service from Cox, but my mom and father in law have the low service and they get these same speeds? Well, I am still very happy with this. Maybe one day, we will have 100/100 speeds.. or even better 1000/1000 speeds! Travis
|
By Travis Whidden on
5/2/2008 3:33 PM
OK, so many of you may have ran into the same problem that I have had trying to set up a number from the sip provider VoiceStick. My specific application requires that I buy 50 - 200 DID numbers. I did a lot of searching, and found a few providers that I wanted to try. These people at VoiceStick were very helpful and seemed to have the most support for non-24 hour services from what I could find anyways.
Now, the only things I can see being a problem with VoiceStick is that they don't do the following:
- They give you an IP address instead of a DNS name to point at their server. If they ever change, well, lets just say you would be in trouble until you found out about the change
- They dont have any kind of network fail over option so like if their network goes down, or they cant hit your server, it wont forward to another number
- No 24 hour support options - If you are down over the weekend, lets hope they know about it.
A huge advantage is that you can buy there .99 cent DID number, and only pay one cent per min on the usage. So if you have a call center, a number that cost more means you are doing some good calls on it. Lets hope the telemarketers stay away.
After some short and quick email correspondences with VoiceStick, I got the details needed to setup my TrixBox with their SIP server. It worked right away, and the quality seems to be very nice!
Settings:

Now, the kicker is you need to adjust your /etc/host file to include the following line:
72.5.80.116 i2telecom.com
Once that is setup, your system will be registered without any issues! In and outbound work just fine.
Hope this helps --- lets just hope they don't change the IP address of the server any time soon!
|
By Travis Whidden on
2/15/2008 11:16 PM
I get so irritated when I read critics from web sites such as rottentomato.com where people say "there are to many plot holes" or "not realistic". the "ending leaves for another movie" WHO CARES! I went tonight with April and two friends of ours. We all really liked it. Maybe set set the bar really low because of these review, but overall, we felt like it was a good, adventurous movie. People need to get off their stool and try to enjoy the movie a little bit. IT NOT REAL... get over it! People expect for a movie to be real even though they are walking into a sci-fi type flick. Anyhow, anyone wanting to enjoy an adventure just needs to go see it. if you question it, go see a matinee movie. For those friends of mien who have opposite film likings... dont go see it ;) Sit back, relax, and enjoy a fun movie.
|
|
|
|
|
 |
 |
 |
 |
|
|
|
|