mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
Support for (read-only) TCP connection agent communication
This commit is contained in:
parent
a72882a743
commit
6b3a51139a
5 changed files with 75 additions and 12 deletions
15
connection.cc
Normal file
15
connection.cc
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
#include "agent.h"
|
||||
#include "connection.h"
|
||||
|
||||
void
|
||||
connection::senses(char around[4])
|
||||
{
|
||||
char buf[1024];
|
||||
snprintf(buf, sizeof(buf), "around %c%c%c%c\n\n", around[0], around[1], around[2], around[3]);
|
||||
write(fd, buf, strlen(buf));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue