DAWN/src/include/networksocket.h
Ian Clowes 1df5bc5dd2 network: cleanup and improve network handling
- Merge encoded / plain messge handling to ensure fixes land in both
- Fix some potential resource leaks spotted by Coverity

[cleanup commit message]
[fix merge conflicts]
Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-06-11 19:59:41 +02:00

31 lines
590 B
C

#ifndef __DAWN_NETWORKSOCKET_H
#define __DAWN_NETWORKSOCKET_H
#include <pthread.h>
/**
* Init a socket using the runopts.
* @param _ip - ip to use.
* @param _port - port to use.
* @param _multicast_socket - if socket should be multicast or broadcast.
* @return the socket.
*/
int init_socket_runopts(const char *_ip, int _port, int _multicast_socket);
/**
* Send message via network.
* @param msg
* @param is_enc
* @return
*/
int send_string(char *msg, bool is_enc);
/**
* Close socket.
*/
void close_socket();
// save connections
// struct sockaddr_in addr[100];
#endif