Posts

Showing posts from July, 2008

A Quick Note On Ports and Sockets

At this point, most people are familiar with the use of an IP address. Basically it is a unique number used on a network to identify a network computer. When we talk about computers communicating with each other, an IP address alone is useless. A single computer may have many programs running that want to communicate over the network. This means that a single address point (the IP address) is not enough to define what program a remote computer would like to communicate with. This is where port numbers come in. A program can bind itself to one or many open ports (meaning they are not currently in use by another program). Once bound to a port, a remote computer can communicate with a program by addressing the computer's address (IP) along with the program's address on that computer (Port). A common misconception is that a socket represents a bound port on a computer (the IP:Port pair). In reality, this is only half of what a socket represents. In fact, a socket represe

Visual Studio Project Settings

When I first started using the settings feature that was built into Visual Studio, I thought that they were pretty straight forward. It turns out that I had virtually no idea what was really going on. This is probably has mostly to do with MSDN's lack of documentation, as usual. Now I will attempt to lay out how this monster really works. First goto the properties page of a project and goto the settings tab. From here you can set up either Application or User settings. It turns out that the differences are pretty self explanitory. A user setting will actually end up in a user.config file burried in the Documents And Settings folder for each user. This means that each user will be able to have a different set of settings for these. Application settings are actually read from the myapp.exe.config file in the application path (usually in Program Files). To access these settings from code, all you need to do is: string mySetting = Properties.Settings.Default.MySetting; If you are acces