Jump to content
xisto Community
Sign in to follow this  
GrumbleBall

C# Socket Programming Help Required

Recommended Posts

I am trying to learn socket programming in C# however, I am struggling to find a thorough, easy to follow tutorial on how to get started with these.Does anybody know of any such tutorials that I may be able to follow? Or alternatively maybe a video on youtube or somewhere explaining how sockets work?There is so much that can be done with sockets but I need to learn them first and I'm struggling a bit with that at the moment :)

Share this post


Link to post
Share on other sites

What programming language are you using now?.NET is a little more abstract and has more libraries for handling specific protocols. For instance, if you want to fetch a webpage or any HTTP link, use the HttpWebRequest class. For more fundamental socket tasks you would use the TcpClient class (https://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx) or TcpListener class (https://msdn.microsoft.com/en-us/library/system.net.sockets.tcplistener.aspx). There are also a few other options in the System.Net.Sockets namespace (https://msdn.microsoft.com/en-us/library/system.net.sockets.aspx).Client/server operations can get hairy really fast, especially on the server side, so I would recommend using something like HttpWebRequest if you can. The MSDN documentation actually provides good information on getting started so that’s the first place I would start. If you have a specific protocol or question I might be able to help you more.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.