Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Winsock/MS question
#1
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
Reply
#2
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.
Reply
#3
ya the winsoick server in MS is a Contorl array , just add (0) after the name and itll become an array.
Reply
#4
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?
Reply
#5
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
Reply
#6
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
Reply
#7
Holla Halla :lol:
Reply
#8
NaMz Wrote:Holla Halla :lol:

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


Forum Jump:


Users browsing this thread: 1 Guest(s)