Fix memory issues in ADC client lib.

This commit is contained in:
Jan Vidar Krey
2009-09-04 17:18:38 +02:00
parent a3d6646b99
commit 96ce64ee07
3 changed files with 34 additions and 13 deletions

View File

@@ -27,6 +27,7 @@
#define NET_EVENT_WRITE 0x0004
#define NET_EVENT_SOCKERROR 0x1000 /* Socket error, closed */
#define NET_EVENT_CLOSED 0x2000 /* Socket closed */
#define NET_EVENT_DESTROYED 0x4000 /* Struct is invalid and can be cleaned up */
struct net_connection;
struct net_timer;
@@ -65,6 +66,13 @@ struct net_connection
extern void net_con_initialize(struct net_connection* con, int sd, struct ip_addr_encap*, net_connection_cb callback, const void* ptr, int events);
extern void net_con_update(struct net_connection* con, int events);
/**
* Close the connection.
* This will ensure a connection is closed properly and will generate a NET_EVENT_DESTROYED event which indicates
* that the con can safely be deleted (or set to NULL)
* NOTE: Do not dele
*/
extern void net_con_close(struct net_connection* con);
/**