One of my students decided he wants to build a multiplayer networked game, and is writing it in VB.NET (2003). He’s been hunting down WinSock programming examples (and understanding very little of them) for a few days now, and (finally) turned to me for help.
Here’s the catch: I did some networked games a few years ago in VB6, but never managed to get the hang of it in VB.NET. I mean, it was blessedly easy back then: You plot the WinSock object on the form, and most of your work is done. I’ve periodically hunted for an equivalently simple example in .NET for a couple years, but never found one. (I even found something today in MSDN, but haven’t taken the time to translate it into English yet. 8^)
So then … are there any experts out there who know what I’m talking about, and can provide a quick tutorial or simple example of a socket based networked program? Even a generic "chat" program would get the basics across. (After all, a networked game is nothing more than a chat program that passes game status back and forth without actually telling the user what’s happening.)
Thanks in advance.
COMMENTS FROM theSpoke:
In the .net SDK, or at least the version that comes with Visual Studio, there’s a sample application WinTalk that demonstrated how to use the System.Net.Sockets namespace.
Thanks, I will look into it. (I figured there had to be something like this.)
Anyone know of an equivalent in VB.NET?
I haven’t looked at it yet but the videos at http://www.franklins.net/video/sockets/ may be useful.
Interesting. Took three tries of running the video on one computer whilst I typed at another, but I think the program works. Now, if only Carl actually explained in detail what the code did and why it works …
(I know, I’m asking a lot for nothing, ain’t I?)