summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/output
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-07-09 03:21:32 +1000
committer Vas Crabb <vas@vastheman.com>2017-07-09 03:21:32 +1000
commitd18aa3e097a4e6c4abe43b175ab08c64c2a5bcbd (patch)
treea6d649ad9f223c21988e5f435c6eb8e941444961 /src/osd/modules/output
parent962fa2ffac3300eb32d24e274bffb7104bd7e653 (diff)
never hurts to srcclean (nw)
Diffstat (limited to 'src/osd/modules/output')
-rw-r--r--src/osd/modules/output/network.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/osd/modules/output/network.cpp b/src/osd/modules/output/network.cpp
index e350cfc99dd..650a815a8ae 100644
--- a/src/osd/modules/output/network.cpp
+++ b/src/osd/modules/output/network.cpp
@@ -41,7 +41,7 @@ public:
void start(running_machine &machine)
{
- m_machine = &machine;
+ m_machine = &machine;
m_clients->insert(shared_from_this());
// now send "hello = 1" to the newly connected client
std::strncpy(m_data, "hello = 1\1", max_length);
@@ -58,43 +58,43 @@ private:
void handle_message(char *msg)
{
- char verb[1024];
- int value;
-
- //printf("handle_message: got [%s]\n", msg);
-
- std::uint32_t ch = 0;
- while (msg[ch] != ' ')
- {
- ch++;
- }
- msg[ch] = '\0';
- ch++;
- std::strncpy(verb, msg, sizeof(verb)-1);
- //printf("verb = [%s], ", verb);
-
- while (msg[ch] != ' ')
- {
- ch++;
- }
-
- ch++;
- value = atoi(&msg[ch]);
- //printf("value = %d\n", value);
-
- if (!std::strcmp(verb, "send_id"))
- {
- if (value == 0)
- {
- std::snprintf(m_data, max_length, "req_id = %s\1", machine().system().name);
+ char verb[1024];
+ int value;
+
+ //printf("handle_message: got [%s]\n", msg);
+
+ std::uint32_t ch = 0;
+ while (msg[ch] != ' ')
+ {
+ ch++;
+ }
+ msg[ch] = '\0';
+ ch++;
+ std::strncpy(verb, msg, sizeof(verb)-1);
+ //printf("verb = [%s], ", verb);
+
+ while (msg[ch] != ' ')
+ {
+ ch++;
+ }
+
+ ch++;
+ value = atoi(&msg[ch]);
+ //printf("value = %d\n", value);
+
+ if (!std::strcmp(verb, "send_id"))
+ {
+ if (value == 0)
+ {
+ std::snprintf(m_data, max_length, "req_id = %s\1", machine().system().name);
}
else
{
- std::snprintf(m_data, max_length, "req_id = %s\1", machine().output().id_to_name(value));
+ std::snprintf(m_data, max_length, "req_id = %s\1", machine().output().id_to_name(value));
}
-
+
do_write(std::strlen(m_data));
- }
+ }
}
void do_read()
@@ -105,11 +105,11 @@ private:
{
if (!ec)
{
- if (length > 0)
- {
- m_input_m_data[length] = '\0';
- handle_message(m_input_m_data);
- }
+ if (length > 0)
+ {
+ m_input_m_data[length] = '\0';
+ handle_message(m_input_m_data);
+ }
do_read();
}
else
@@ -148,7 +148,7 @@ public:
output_network_server(asio::io_context& io_context, short port, running_machine &machine) :
m_acceptor(io_context, asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port))
{
- m_machine = &machine;
+ m_machine = &machine;
do_accept();
}