Need help with Sockets

Zumwalt
07-20-2005, 01:05 PM
I have a Tic Tac Toe game that I need to figure a piece of the puzzle out on, as a whole, it works (this was origanlly written in a vb.net book, I modified it to fit my needs), the problem is, the book didn't really explain very well how to create a listener that can add each connection to a collection and clear the listener to accept another connection.

This is only working for 2 connections.

What I need to learn how to do, and hopefully someone can give me a pointer or show me to a book I can read on how to accomplish this, is to allow a dynamic growth of my collection of players, and know if a collection item is used or open.

I figured I would have to create a collection and one of the objects in the collection item would be a 'dirty' flag or a 'used' flag, when the person disconnects, change the flag to available.

What I don't get, is how to move a connection around, meaning my player(0) is the listening channel, when someone connects, it moves them from player(0) to player(open), if there is no player(open) create a new player(x).

Here is the working code.No binaries please. Please remove all compiled files and re-post the attachment. Thanks.

Zumwalt
07-20-2005, 02:35 PM
Sorry, didn't realize the Debug folder had the binary still in it, here is a repost without the debug binaries.

Edit:

The eto information is in there because I use Enterprise templates:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxorienterprisetemplates.asp

If you do not use VS 2002+ with ET, then just create a new project in VS (insert your version here), then add the form and vb files to the project, should compile fine.

Make sure you have 2 seperate projects, one for the client, one for the server, they can be in the same solution, but you need the two.

Zumwalt
07-22-2005, 07:41 AM
This is the zip for those who have professional 2002 +

Zumwalt
08-11-2005, 07:40 AM
Good morning everyone, I am still trying to figure this out, although my problem in how fast I am finding a solution is more do to personal reasons.

Can anyone point me to a good book on vb.net with winsocks that goes into detail?

If you know of a stronger / better solution also please post and I will look into it, I am all ears.

MSDN is just not clear to me at the moment on what / how to work through this.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum