mirror of
https://github.com/brmlab/brmlife.git
synced 2025-08-02 18:03:37 +02:00
~connection(): Close file descriptor
This commit is contained in:
parent
2603aacf1f
commit
978a080656
2 changed files with 8 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
|||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "agent.h"
|
||||
#include "connection.h"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef BRMLIFE__CONNECTION_H
|
||||
#define BRMLIFE__CONNECTION_H
|
||||
|
||||
#include <cstdio>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "map.h"
|
||||
|
||||
|
@ -11,6 +11,11 @@ public:
|
|||
|
||||
connection(int fd_) : fd(fd_) {}
|
||||
|
||||
~connection()
|
||||
{
|
||||
close(fd);
|
||||
}
|
||||
|
||||
void senses(int tick_id, char around[4]);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue