Piszę program servera w .NET 2003 w MFC
Po zaakceptowaniu połączenia tworzę nowy wątek, w którym chce odbierać dane.
Przy debugowaniu (w linijce gdzie jest deklaracja CSocketFile file(&listener) ) wyskakuje błąd: Unhandled exception at 0x77fa144b in Server.exe: User breakpoint.
Jak naprawić ten problem?
Panowie pomóżcie, proszę
void CServerDlg::OnBnClickedOk()
{
...........
//Na początku tworzę gniazdko i akceptuje połączenie
gniazdko.Create(4444);
gniazdko.Listen();gniazdko.
CSocket *g=new CSocket;
gniazdko.Accept(*g);
// i wywołuję funkcje wątku
AfxBeginThread(Watek,g);
.............
}
UINT CServerDlg::Watek(LPVOID lParam)
{
AfxSocketInit();
CSocket listener;
listener.Attach(SOCKET (lParam));
CSocketFile file(&listener); //Unhandled exception at 0x77fa144b in Server.exe: User breakpoint.
CArchive ar(&file, CArchive::load);
CString tekst;
ar >> tekst;
return 0;
}
}</u></b>