The Wayback Machine - http://web.archive.org/web/20200606100004/https://github.com/acl-dev/acl/issues/170
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib_acl_cpp的socket示例中,打开端口失败 #170

Open
hellokandy opened this issue Aug 23, 2019 · 2 comments
Open

lib_acl_cpp的socket示例中,打开端口失败 #170

hellokandy opened this issue Aug 23, 2019 · 2 comments

Comments

@hellokandy
Copy link

@hellokandy hellokandy commented Aug 23, 2019

路径 :acl\lib_acl_cpp\samples\socket[s1|s2|server]
问题描述:打开地址的时候,一直都是失败的!
`acl::server_socket server;
acl::string addr = "127.0.0.1:9001";

if (argc >= 2)
	addr = argv[1];

if (server.open(addr) == false)//这里会打开失败
{
	printf("open %s error\r\n", addr.c_str());
	return 1;
}
else
	printf("open %s ok\r\n", addr.c_str());`
@zhengshuxin
Copy link
Member

@zhengshuxin zhengshuxin commented Aug 23, 2019

因为在Windows平台下 SOCKET 需要初始化,而这几个例子最初是针对 UNIX 平台编写的。现在已经修改可以在Windows下运行了,方法是在进程开始处通过添加方法 acl::acl_cpp_init() 来初始化 SOCKET。
--zsx

@hellokandy
Copy link
Author

@hellokandy hellokandy commented Aug 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.