What I'm wondering is, am I allowed to do this
client_db.clients[numberOfClients].sock = listener.Accept();
For my networking class I'm writing a chat client and a server that it connects to. I have an array of client objects that contains various info about each of the people connecting to the server. Before when dealing with one client, I would have a socket be equal to listener.Accept, and then I'd do all my stuff with that socket. I incorrectly assumed I could use an array of sockets to have multiple TCP connections with multiple clients.
Is there a way to do this? I realize there are probably more efficient ways to do this, but I'm still getting the hang of network programming, and more importantly, my server is currently based around the idea of me using a socket array. If there's no way to do it, this is certainly a lesson I'll remember.
EDIT: I was under the impression this didn't work because I got an exception saying something about "cannot have multiple connections," though I can't get that exception again. Now I am getting an object error. I'm confused, I need to look into this some more..