user-0 提问: Socket服务器，同一份代码，debug可正常通信，release失败

回复:
user: user-1
content: 引用 9 楼 cyyhehehe 的回复:谢谢各位，找到原因了，其实是release下SOCKET访问被系统防火墙禁止了。 楼主您好，我电脑的防火墙已经关了，debug可以，release还是不行。请问下具体操作，是如何允许release下SOCKET访问?

user: user-0
content: 谢谢各位，找到原因了，其实是release下SOCKET访问被系统防火墙禁止了。

user: user-2
content: debug内存管理和release是不一样的，猜测你应该是某端代码写的不标准引起的。  程序有日志功能不，把listen、accept相关ip地址都打印出来，没有就用MessageBox

user: user-3
content: 学会使用抓包软件wireshark

user: user-0
content: 引用 5 楼 user-4 的回复:PID 为0的进程是系统进程，你自己的程序的pid肯定不会是0.5037是adb默认端口，自己建程序建议建大一点的端口号，小的端口号很多都被占用了，容易导致程序出问题。  感谢回答。 5037这个端口的现象应该跟此题无关。 按照你的建议改成30000的端口了，这个问题还是存在。Release模式下，无法建立连接。是否有其他的跟踪调试手段呢？

user: user-4
content: PID 为0的进程是系统进程，你自己的程序的pid肯定不会是0.5037是adb默认端口，自己建程序建议建大一点的端口号，小的端口号很多都被占用了，容易导致程序出问题。

user: user-4
content: 第二张图下面那个5050才是你的程序吧。如果不是你的程序的话，就是5050端口被下面那个占用了。是不是debug忘关了？

user: user-3
content: 引用 2 楼 cyyhehehe 的回复:[quote=引用 1 楼 zhao4zhong1 的回复:] inet_ntoa The Windows Sockets inet_ntoa function converts an (Ipv4) Internet network address into a string in Internet standard dotted format.  char FAR * inet_ntoa (   struct in_addr in   );   Parameters in  [in] A structure that represents an Internet host address.  Remarks The inet_ntoa function takes an Internet address structure specified by the in parameter and returns an ASCII string representing the address in ".'' (dot) notation as in "a.b.c.d''. The string returned by inet_ntoa resides in memory that is allocated by Windows Sockets. The application should not make any assumptions about the way in which the memory is allocated. The data is guaranteed to be valid until the next Windows Sockets function call within the same thread, but no longer. Therefore, the data should be copied before another Windows Sockets call is made.  Return Values If no error occurs, inet_ntoa returns a char pointer to a static buffer containing the text address in standard ".'' notation. Otherwise, it returns NULL.   QuickInfo   Windows NT: Yes   Windows: Yes   Windows CE: Use version 1.0 and later.   Header: Declared in winsock2.h.   Import Library: Link with ws2_32.lib.  See Also inet_addr 感谢回复，但不太明白红字部分要表达的意思[/quote] QQ:511606848 支付宝:zhao4zhong1@163.com ￥100 包教会，包解决。

user: user-0
content: 引用 1 楼 zhao4zhong1 的回复:inet_ntoa The Windows Sockets inet_ntoa function converts an (Ipv4) Internet network address into a string in Internet standard dotted format.  char FAR * inet_ntoa (   struct in_addr in   );   Parameters in  [in] A structure that represents an Internet host address.  Remarks The inet_ntoa function takes an Internet address structure specified by the in parameter and returns an ASCII string representing the address in ".'' (dot) notation as in "a.b.c.d''. The string returned by inet_ntoa resides in memory that is allocated by Windows Sockets. The application should not make any assumptions about the way in which the memory is allocated. The data is guaranteed to be valid until the next Windows Sockets function call within the same thread, but no longer. Therefore, the data should be copied before another Windows Sockets call is made.  Return Values If no error occurs, inet_ntoa returns a char pointer to a static buffer containing the text address in standard ".'' notation. Otherwise, it returns NULL.   QuickInfo   Windows NT: Yes   Windows: Yes   Windows CE: Use version 1.0 and later.   Header: Declared in winsock2.h.   Import Library: Link with ws2_32.lib.  See Also inet_addr 感谢回复，但不太明白红字部分要表达的意思

user: user-3
content: inet_ntoa The Windows Sockets inet_ntoa function converts an (Ipv4) Internet network address into a string in Internet standard dotted format.  char FAR * inet_ntoa (   struct in_addr in   );   Parameters in  [in] A structure that represents an Internet host address.  Remarks The inet_ntoa function takes an Internet address structure specified by the in parameter and returns an ASCII string representing the address in ".'' (dot) notation as in "a.b.c.d''. The string returned by inet_ntoa resides in memory that is allocated by Windows Sockets. The application should not make any assumptions about the way in which the memory is allocated. The data is guaranteed to be valid until the next Windows Sockets function call within the same thread, but no longer. Therefore, the data should be copied before another Windows Sockets call is made.  Return Values If no error occurs, inet_ntoa returns a char pointer to a static buffer containing the text address in standard ".'' notation. Otherwise, it returns NULL.   QuickInfo   Windows NT: Yes   Windows: Yes   Windows CE: Use version 1.0 and later.   Header: Declared in winsock2.h.   Import Library: Link with ws2_32.lib.  See Also inet_addr