[DEV] update to future lutin 2.0
This commit is contained in:
parent
8d9800b3e8
commit
62f305cf89
@ -26,8 +26,8 @@ def get_maintainer():
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_export_path(tools.get_current_path(__file__))
|
||||
my_module.add_module_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_path(tools.get_current_path(__file__), export=True)
|
||||
my_module.add_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_src_file([
|
||||
'test/main-client-http.cpp'
|
||||
])
|
||||
|
@ -26,8 +26,8 @@ def get_maintainer():
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_export_path(tools.get_current_path(__file__))
|
||||
my_module.add_module_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_path(tools.get_current_path(__file__), export=True)
|
||||
my_module.add_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_src_file([
|
||||
'test/main-client-websocket.cpp'
|
||||
])
|
||||
|
@ -26,8 +26,8 @@ def get_maintainer():
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_export_path(tools.get_current_path(__file__))
|
||||
my_module.add_module_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_path(tools.get_current_path(__file__), export=True)
|
||||
my_module.add_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_src_file([
|
||||
'test/main-client.cpp'
|
||||
])
|
||||
|
@ -26,8 +26,8 @@ def get_maintainer():
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_export_path(tools.get_current_path(__file__))
|
||||
my_module.add_module_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_path(tools.get_current_path(__file__), export=True)
|
||||
my_module.add_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_src_file([
|
||||
'test/main-server-http.cpp'
|
||||
])
|
||||
|
@ -26,8 +26,8 @@ def get_maintainer():
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_export_path(tools.get_current_path(__file__))
|
||||
my_module.add_module_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_path(tools.get_current_path(__file__), export=True)
|
||||
my_module.add_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_src_file([
|
||||
'test/main-server-websocket.cpp'
|
||||
])
|
||||
|
@ -26,8 +26,8 @@ def get_maintainer():
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_export_path(tools.get_current_path(__file__))
|
||||
my_module.add_module_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_path(tools.get_current_path(__file__), export=True)
|
||||
my_module.add_depend(['enet', 'gtest', 'test-debug'])
|
||||
my_module.add_src_file([
|
||||
'test/main-server.cpp'
|
||||
])
|
||||
|
@ -26,12 +26,12 @@ def get_version():
|
||||
|
||||
def create(target, module_name):
|
||||
my_module = module.Module(__file__, module_name, get_type())
|
||||
my_module.add_module_depend(['etk', 'ememory', 'algue'])
|
||||
my_module.add_depend(['etk', 'ememory', 'algue'])
|
||||
my_module.add_src_file([
|
||||
'enet/debug.cpp'
|
||||
])
|
||||
my_module.add_path(tools.get_current_path(__file__))
|
||||
if target.name == "Windows":
|
||||
if "Windows" in target.get_type():
|
||||
return my_module
|
||||
my_module.add_src_file([
|
||||
'enet/Udp.cpp',
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <test-debug/debug.h>
|
||||
#include <enet/Tcp.h>
|
||||
#include <enet/TcpClient.h>
|
||||
#include <enet/Http.h>
|
||||
#include <etk/etk.h>
|
||||
|
||||
@ -28,17 +29,15 @@ int main(int _argc, const char *_argv[]) {
|
||||
TEST_INFO("==================================");
|
||||
#ifndef __TARGET_OS__Windows
|
||||
// client mode ...
|
||||
enet::Tcp connection;
|
||||
connection.setHostNane("127.0.0.1");
|
||||
connection.setPort(31235);
|
||||
connection.setServer(false);
|
||||
// connect on TCP server:
|
||||
enet::Tcp connection = std::move(enet::connectTcpClient("127.0.0.1", 12345));
|
||||
TEST_INFO("CLIENT connect ...");
|
||||
if (connection.link() == false) {
|
||||
if (connection.getConnectionStatus() != enet::Tcp::status::link) {
|
||||
TEST_ERROR("can not link to the socket...");
|
||||
return -1;
|
||||
}
|
||||
int32_t iii = 0;
|
||||
while ( connection.getConnectionStatus() == enet::Tcp::statusLink
|
||||
while ( connection.getConnectionStatus() == enet::Tcp::status::link
|
||||
&& iii<10000) {
|
||||
char data[1024];
|
||||
int32_t len = connection.read(data, 1024);
|
||||
@ -51,7 +50,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
}
|
||||
if (iii>=10000) {
|
||||
TEST_INFO("auto disconnected");
|
||||
} else if (connection.getConnectionStatus() != enet::Tcp::statusLink) {
|
||||
} else if (connection.getConnectionStatus() != enet::Tcp::status::link) {
|
||||
TEST_INFO("server disconnected");
|
||||
} else {
|
||||
TEST_INFO("ERROR disconnected");
|
||||
|
@ -41,7 +41,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
interface.unlink();
|
||||
|
||||
int32_t iii = 0;
|
||||
while (tcpConnection.isAlive() == true) {
|
||||
while (tcpConnection.getConnectionStatus() == enet::Tcp::status::link) {
|
||||
int32_t len = tcpConnection.write("plop" + etk::to_string(iii));
|
||||
TEST_INFO("write len=" << len);
|
||||
char data[1024];
|
||||
@ -53,7 +53,7 @@ int main(int _argc, const char *_argv[]) {
|
||||
}
|
||||
if (iii>=1000000) {
|
||||
TEST_INFO("auto disconnected");
|
||||
} else if (tcpConnection.isAlive() != true) {
|
||||
} else if (tcpConnection.getConnectionStatus() != enet::Tcp::status::link) {
|
||||
TEST_INFO("server disconnected");
|
||||
} else {
|
||||
TEST_INFO("ERROR disconnected");
|
||||
|
Loading…
x
Reference in New Issue
Block a user