{"id":4801,"date":"2013-10-20T05:06:35","date_gmt":"2013-10-19T18:06:35","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4801"},"modified":"2013-10-20T05:06:35","modified_gmt":"2013-10-19T18:06:35","slug":"c-socket-primer-tutoria","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-socket-primer-tutoria\/","title":{"rendered":"C# Socket Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/CHash\/Socket\/CHash_socket_Primer.jpg\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"C# Socket Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/CHash\/Socket\/CHash_socket_Primer.jpg\" title=\"C# Socket Primer Tutorial\"   \/><\/a><p class=\"wp-caption-text\">C# Socket Primer Tutorial<\/p><\/div>\n<p>C# using Visual Studio on Windows is a great language to  <a target=_blank title='click picture' href='http:\/\/www.rjmprogramming.com.au\/VB.NET\/VBdotNet-Windows-Form-Desktop-Application-VisualStudio.png'>learn<\/a>.   If you like C# you may eventually like VB.Net, and vice versa.   It has sophisticated data structures, can be Object Oriented and makes great Windows desktop applications or can be the code behind an ASP.Net website or web application.     <\/p>\n<p>C# and VB.Net have Visual Studio support for functionality to do with networking and the use of sockets, as described below at Wikipedia.<\/p>\n<blockquote><p>A network socket is an endpoint of an inter-process communication flow across a computer network. Today, most communication between computers is based on the Internet Protocol; therefore most network sockets are Internet sockets.<\/p>\n<p>A socket API is an application programming interface (API), usually provided by the operating system, that allows application programs to control and use network sockets. Internet socket APIs are usually based on the Berkeley sockets standard.<\/p>\n<p>A socket address is the combination of an IP address and a port number, much like one end of a telephone connection is the combination of a phone number and a particular extension. Based on this address, internet sockets deliver incoming data packets to the appropriate application process or thread.<\/p><\/blockquote>\n<p>Hope you enjoy the <a target=_blank title='C# Socket Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/CHash\/Socket\/CHash_socket_Primer.jpg'>tutorial<\/a> in which we create a socket for communications using the http protocol to a host of your choosing &#8230; we chose google.com &#8230; you will need to have your internet connection working and check that the firewall settings allow port 80 to communicate with a socket.   In this tutorial we establish a socket and make a request and receive a response.   In practice you would continue on with more sophistication.<\/p>\n<p>Here is some downloadable C# programming source code which you might want to rename to <a target=_blank title='Program.cs' href='http:\/\/www.rjmprogramming.com.au\/CHash\/Socket\/Program.cs_GETME'>Program.cs<\/a><\/p>\n<p>The Socket Class <a target=_blank title='Socket tutorial from Microsoft' href='http:\/\/msdn.microsoft.com\/en-us\/library\/system.net.sockets.socket.aspx'>tutorial<\/a> was used and amended only slightly for this tutorial, so please start here on the path to further examination of this very interesting and fundamental area of network programming.<\/a><\/p>\n<p>Link to Socket information from <a target=_blank title='socket information from Wikipedia' href='http:\/\/en.wikipedia.org\/wiki\/Network_socket'>Wikipedia<\/a>, from where the quote above came.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d4801' onclick='var dv=document.getElementById(\"d4801\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=C%23\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d4801' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>C# using Visual Studio on Windows is a great language to learn. If you like C# you may eventually like VB.Net, and vice versa. It has sophisticated data structures, can be Object Oriented and makes great Windows desktop applications or &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/c-socket-primer-tutoria\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,25,37,39],"tags":[43,176,837,997,1164,1319,1383,1435],"class_list":["post-4801","post","type-post","status-publish","format-standard","hentry","category-elearning","category-networking","category-tutorials","category-visual-studio","tag-net","tag-c","tag-networking-2","tag-programming","tag-socket","tag-tutorial","tag-visual-studio","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4801"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=4801"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/4801\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=4801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=4801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=4801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}