Well I remember writing one a long time ago but I forgot how I looped to wait for a connection.... any ideas on how to do it?
Well I remember writing one a long time ago but I forgot how I looped to wait for a connection.... any ideas on how to do it?
Open listening socket and assign a callback that will be called when incoming connection arrives?
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Under Windows and using winsocks you can use a new thread and pass to it a 'copy' of the socket accepted; then on that new thread just call and recall the receive/send functions till you get the close instruction.
Hope that helps.
Niara