you've declared static vars - you need to define them somewhere
<br />
Cthread::vnsSocket=0;<br />
similarly with the other var
Additionally, i wouldn't do it quite that way ... pass the
this
of your class in as the
beginthread
cookie, have ONE static function for thread entry, that casts the cookie back to your class, then call that instance's receive handler
that way you don't need to have any static vars, and you can have multiple instances of the class