Mirage Source
Winsock/MS question - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Winsock/MS question (/showthread.php?tid=291)



Winsock/MS question - halla - 07-09-2006

Well im learning Winsock and all of that... made a basic chat program. It is chat between a server and a client. But it only supports one client. I looked up stuff and people said to use an array of winsock to get more connections. Is this the way its done on MS or is it done another way?

Also since im starting from scratch should I just learn that IOCP instead since its supposed to be faster?

Thanks


- pingu - 07-09-2006

Learn Winsock first, it's for the basics.

And yes, Mirage uses an array of winsock connections. The "index" number is actually your aissned Winsock control on the server.


- grimsk8ter11 - 07-09-2006

ya the winsoick server in MS is a Contorl array , just add (0) after the name and itll become an array.


- halla - 07-09-2006

Yea I have been learning them.

I can get a basic 1 to 1 connection set up.... get the server listening receiving data ... client connecting and sending data and so on

yeah thats how I was told to do it I didnt know if thats why MS did though. I guess thats the way to go then.

So more less when connecting I have to get it to find the next open winsock right

or do I have the server take it on winsock(0) then give it another winsock value... so that (0) stays open for new connections? i think the 2nd one I said is right correct?


- halla - 07-09-2006

Dave Wrote:Correct, you need to move the winsock(0) to another value to keep (0) the only one listening.

ok thanks thought so...

so...

where it receives connections add something like

number = number + 1
i = number

then have winsock(i) as the thing it sets it too...

or is there a better way of doing this...

thanks im just trying to learn about it as much as I can


- halla - 08-09-2006

hmm wouldnt mine work also since its always adding 1 on to it... well I guess if it goes back to 0 then it would always be 1... oh well I will mess around with it more..

and ms is different from how I have been doin git and reading to do it


- NaMz - 09-09-2006

Holla Halla :lol:


- halla - 10-09-2006

NaMz Wrote:Holla Halla :lol:

not how I got my name... from my last name and yes like you I used to rap