Click here to Skip to main content
15,891,704 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralLinker errors Pin
monrobot1320-Sep-02 15:17
monrobot1320-Sep-02 15:17 
GeneralRe: Linker errors Pin
Le centriste20-Sep-02 17:52
Le centriste20-Sep-02 17:52 
GeneralRe: Linker errors Pin
monrobot1321-Sep-02 2:21
monrobot1321-Sep-02 2:21 
GeneralRe: Linker errors Pin
Le centriste22-Sep-02 9:28
Le centriste22-Sep-02 9:28 
Questionlparam question? Pin
imran_rafique20-Sep-02 14:48
imran_rafique20-Sep-02 14:48 
AnswerRe: lparam question? Pin
Paul M Watt20-Sep-02 17:55
mentorPaul M Watt20-Sep-02 17:55 
GeneralIn search of a better tree control. Pin
Tony Fontenot20-Sep-02 12:04
Tony Fontenot20-Sep-02 12:04 
GeneralProblem in making multithreading Winsock Server Pin
nachilau20-Sep-02 11:24
nachilau20-Sep-02 11:24 
Hello,

I am changing my server to support multithreading. However, I have problem. This is how the server main loop is

<br />
//######################################################################<br />
 // Main Server loop<br />
<br />
 CSocket clientS;<br />
<br />
 while (run)<br />
 {<br />
  Print_Log("A loop... : mainServer->Start()");<br />
  cs.Accept(clientS);<br />
  hSThread = CreateThread(NULL, 0, ServiceThread, &clientS, 0, &threadId);<br />
 } // end while...loop<br />
<br />
 //######################################################################<br />
<br />


Here is my thread call back function:

<br />
DWORD WINAPI ServiceThread(LPVOID p)<br />
{<br />
 CSocket* clientS = ((CSocket*)p);<br />
 int re;<br />
 char r[6];<br />
<br />
 do<br />
 {<br />
  re = clientS->Receive(r, 6);<br />
  if (re != 0)<br />
    cout << r << endl;<br />
 } while (re != 0);<br />
 clientS->Close();<br />
 return 0;<br />
} // end of function ServiceThread()<br />
<br />


I get a error message when the client send me somehing, which is "Debug Assertion Fail". The server can actually receive the message, but when the thread is going to close. The error message come out. I didn't know where my code have make the mistake. Can anyone help me? Thanks!

Nachi Dead | X|
Generaltab control problem Pin
Brad Jennings20-Sep-02 11:25
Brad Jennings20-Sep-02 11:25 
GeneralRe: tab control problem Pin
Brad Jennings20-Sep-02 11:41
Brad Jennings20-Sep-02 11:41 
GeneralCOleClientItem Pin
Gary Kirkham20-Sep-02 10:37
Gary Kirkham20-Sep-02 10:37 
QuestionSendMessage not sending? Pin
ns20-Sep-02 10:21
ns20-Sep-02 10:21 
AnswerRe: SendMessage not sending? Pin
Joaquín M López Muñoz20-Sep-02 10:24
Joaquín M López Muñoz20-Sep-02 10:24 
GeneralRe: SendMessage not sending? Pin
ns20-Sep-02 10:36
ns20-Sep-02 10:36 
GeneralRe: SendMessage not sending? Pin
ns20-Sep-02 10:45
ns20-Sep-02 10:45 
GeneralGetSafeHwnd() Pin
ns20-Sep-02 10:10
ns20-Sep-02 10:10 
GeneralRe: PArameter Type problem Pin
Joaquín M López Muñoz20-Sep-02 10:12
Joaquín M López Muñoz20-Sep-02 10:12 
GeneralRe: PArameter Type problem Pin
ns20-Sep-02 10:17
ns20-Sep-02 10:17 
GeneralVisual C++.NET Problem Pin
valikac20-Sep-02 9:01
valikac20-Sep-02 9:01 
GeneralRe: Visual C++.NET Problem Pin
Joaquín M López Muñoz20-Sep-02 9:48
Joaquín M López Muñoz20-Sep-02 9:48 
GeneralRe: Visual C++.NET Problem Pin
valikac20-Sep-02 9:50
valikac20-Sep-02 9:50 
GeneralRe: Visual C++.NET Problem Pin
Mike Nordell20-Sep-02 10:10
Mike Nordell20-Sep-02 10:10 
GeneralVoice chat Pin
fahadmunir3320-Sep-02 8:28
fahadmunir3320-Sep-02 8:28 
GeneralRe: Voice chat Pin
Mike Nordell21-Sep-02 11:08
Mike Nordell21-Sep-02 11:08 
GeneralQuestion about using CSocket writing a server Pin
nachilau20-Sep-02 8:23
nachilau20-Sep-02 8:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.