The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: travism on June 02, 2009, 03:29:49 AM

Title: Creating more than one socket...
Post by: travism on June 02, 2009, 03:29:49 AM
Im writing a http 1.1 compliant web server and Im trying to think how to create a new socket for each connection because im suppose to close the socket after each request. Just some basic questions after reading the rfc :) thanks guys.
Title: Re: Creating more than one socket...
Post by: Tedd on June 02, 2009, 11:51:04 AM
You get a NEW socket from accept for each incoming connection, so you don't actually create them. And when you've closed one, destroy it and forget it (otherwise winsock will run out of handles.... eventually.)
Title: Re: Creating more than one socket...
Post by: travism on June 03, 2009, 02:49:39 AM
Well that's what I was wondering if I close the handle to the socket all associated connections will die so how do I know which one to close. I'm almost thinking like what I used to do in high languages was index sockets. Would I need to do something like that?