FS-9952: Added envelope to queue sending messages, prepping for initial server transport testing

This commit is contained in:
Shane Bryldt authored and Mike Jerris committed 2017-03-22 17:42:49 -04:00
1 parent fa6a4e7686
commit 7e2d375d76
5 files changed
+133 -86

No files matched your search

+5 -8
View File
@@ -16,7 +16,6 @@ char g_console_input[CONSOLE_INPUT_MAX];
size_t g_console_input_length = 0;
size_t g_console_input_eol = 0;
void service_peer_state_callback(blade_service_t *service, blade_peer_t *peer, blade_peerstate_t state);
void loop(blade_handle_t *bh);
void process_console_input(blade_handle_t *bh, char *line);
@@ -71,11 +70,13 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
if (blade_handle_startup(bh, config_blade, service_peer_state_callback) != KS_STATUS_SUCCESS) {
if (blade_handle_startup(bh, config_blade) != KS_STATUS_SUCCESS) {
ks_log(KS_LOG_ERROR, "Blade startup failed\n");
return EXIT_FAILURE;
}
// @todo get to wss module callbacks, call onload to kick off registration
loop(bh);
blade_handle_destroy(&bh);
@@ -85,12 +86,8 @@ int main(int argc, char **argv)
return 0;
}
void service_peer_state_callback(blade_service_t *service, blade_peer_t *peer, blade_peerstate_t state)
{
// @todo log output and pop peer messages if state == BLADE_PEERSTATE_RECEIVING
ks_log(KS_LOG_INFO, "service peer state callback: %d\n", (int)state);
}
void buffer_console_input(void)
{
ssize_t bytes = 0;
+10 -36
View File
@@ -1,28 +1,5 @@
blade:
{
# client stuff, for peers who connect out to services
client:
{
directory:
{
# todo: hints for ways to find a directory service, at least kws client_data for now
# add DNS SRV in the future
uri = "???:127.0.0.1+2100:???"; # todo: confirm expected format, "uri:host:proto"
websocket:
{
# SSL group is optional, disabled when absent
ssl:
{
# todo: client SSL stuffs here
};
};
};
};
# server stuff, for services that peers connect to
# todo: consider encapsulating in a "server" group for organizational structure
datastore:
{
database:
@@ -30,21 +7,18 @@ blade:
path = ":mem:";
};
};
service:
wss:
{
websockets:
endpoints:
{
endpoints:
{
ipv4 = ( { address = "0.0.0.0", port = 2100 } );
ipv6 = ( { address = "::", port = 2100 } );
backlog = 128;
};
# SSL group is optional, disabled when absent
ssl:
{
# todo: service SSL stuffs here
};
ipv4 = ( { address = "0.0.0.0", port = 2100 } );
ipv6 = ( { address = "::", port = 2100 } );
backlog = 128;
};
# SSL group is optional, disabled when absent
ssl:
{
# todo: server SSL stuffs here
};
};
};