[color=blue]
> I am writing a windows socket program and it contains some threading in it
> as well. I connect the client to the server and they talk fine until i spawn
> a thread that takes care of the client while my server tried to accept
> another connection.
>
> while the functon that is being run by the thread is executing, the server
> is also getting ready to accept a new connection and it executes the "accept"
> command. Now at this point the function being executed by the thread gives me
> this violation at the first "send" command in that is present in that
> function.
>
> Does anyone have an idea why this might be happening? could it be because of
> the thread or is it something else?
>[/color]
The thread-based design should not cause such problems by itself.
Try to determine what address is being accessed when the exception is raised,
and why is it invalid. The buffer (and its size) passed to send() should probably
be the first suspects.
Regards,
Oleg
[VC++ MVP
http://www.debuginfo.com/]