We hope the following tutorial helps get you up and running as quickly as possible. If you feel something is missing or confusing please leave a comment below. If this tutorial is not exactly what you were after please see our tutorials section for more information.

What you need to get up and running:

  1. Visual Studio 2010 Express or better (Including .Net4).
  2. The latest release of NetworkComms.Net. Please see our Download section.

Then what?

Once you have everything you need you probably want to start working your way through the included examples.

Part 1 – Compile the examples …

  1. Extract the downloaded zip file to a suitable location.
  2. Browser to the location chosen in step 1 and open the examples solution file (Examples\NetworkComms.Net Examples.sln). This should open in Visual Studio. Note: You may see notifications related to Unsupported project types for platforms such as Windows Phone, iOS etc, due to missing necessary SDKs, you can safely ignore these notifications.
  3. Compile all projects by hitting F6 or right clicking on the solution within Visual Studio’s Solution Explorer Window and select ‘Build Solution’. This creates the necessary project executables. Note: If you see any build errors due to namespaces ‘ProtoBuf’ or ‘NLog’ please ensure your NuGet Package Manager is correctly configured. These are external packages/dependencies that should be downloaded when you first build the solution.

Part 2 – Run the basic example  …

  1. You can run all of the examples on the same computer or across different ones. For the sake of this demonstration we will run them both locally (Just make the appropriate IP change when requested if running on different computers).
  2. Browse to the location where you extracted the solution in Part 1. Now browse to  “ExamplesConsole\bin\Debug\” . This directory should contain the executables compiled in Part 1. If not make sure Visual Studio is configured to build Debug.
  3. Execute “ExamplesConsole.exe”. This should open in a new console window. Press ‘n’ to leave logging disabled.
  4. Run the basic example by selecting option ’1′.
  5. The output of the console should be reset and now start with a line saying  “Listening for messages on:” . What follows is a list of all IPs detected on the local machine and the port number now opened by the example. You may be presented with various firewall messages asking if you trust the application to open the desired port, ensure you DO give the necessary permissions.
  6. You now need to open a second instance of “ExamplesConsole.exe”. This can be on the same or different computer. Make sure you select the basic example again using option ’1′.
  7. The output of the second instance should again start with  “Listening for messages on:” .
  8. You can now send messages from one instance to the other using NetworkComms.Net. In the instance of your choice type a message as directed and press return.
  9. Enter the IP address and port of the destination instance. This should be in the form IPAddress:Port, e.g. 192.168.1.56:10000.
  10. Press enter and hopefully the message appears in the destination instance.
  11. Checkout the source code to see how short the example actually is. You can view the example source in Visual Studio by browsing to the ‘BasicSend.cs’ code file within the ExamplesConsole project. The code is also included below.
  12. Bear in mind it is possible to break the basic example. No error handling was included to help keep things as short as possible.

Part 3 – Run the other examples and discover the more advanced features available …

  1. Execute “ExamplesConsole.exe” as in part 2 and following directions provided when the other examples are selected. If you have any problems see here.

Projects in Examples Solution:

The following projects have been included to help demonstrate the majority of NetworkComms.Net features:

  • ExamplesChat.Android - This is the ported version of the WPF chat application to Android devices. Regardless of platform all chat applications can communicate.
  • ExamplesChat.iOS - This is the ported version of the WPF chat application to iOS devices.
  • ExamplesChat.WinRT - This is the ported version of the WPF chat application to WinRT/Windows Store.
  • ExamplesChat.WP8 - This is the ported version of the WPF chat application to Windows Phone 8.
  • ExamplesChat.WPF - A simple WPF client server chat example that demonstrates the core features, i.e. TCP, UDP, Encryption etc.
  • ExamplesConsole – A large number of console based examples written in C#, that attempt to demonstrate the majority of library features.
  • ExamplesConsole.VB – A number of console based examples written in VB.Net. At the present time only the BasicSend example is available.

Things to also be aware of:

The download package includes suitable XML and PDB files associated with the build. We highly recommend you include these files any any of your projects, alongside the DLLs, so that you get suitable intellisense information and also easier debugging. For more information please read this article on why PDB files are useful, and this article for attaching source code.

What to do if you have problems:

You first source of help should be the forums, it may well be someone else has experienced and solved a similar problem before. If you have found a genuine error please fill out a bug report here. We also offer commercial support packages.