做了一个简单的网络程序,但服务端在执行到accept()时死机,自动退出。
编译通过,单步执行,调试发现运行到sClient=accept(sListen);//ACCEPT死机,不占CPU,不占内存
output窗口有:
Loaded 'C:\WINNT\system32\wshtcpip.dll', no matching symbolic information found.
First-chance exception in liti.exe: 0xC0000005: Access Violation.
最后一句是提示。(前面的是调用动态库,应该是正确的)。
编译通过,单步执行,调试发现运行到sClient=accept(sListen);//ACCEPT死机,不占CPU,不占内存
output窗口有:
Loaded 'C:\WINNT\system32\wshtcpip.dll', no matching symbolic information found.
First-chance exception in liti.exe: 0xC0000005: Access Violation.
最后一句是提示。(前面的是调用动态库,应该是正确的)。
It may be memory fault by all appearances
please check the resource free part
如果是应该要用到ws2_32.lib和头文件#include "winsock2.h"
如果有客户端连接了,程序就会望下走了.
估计你先启动服务端,然后就死在那里了,这时你不要管,启动客户端,服务端程序就出来