Source
13
13
** GNU General Public License for more details.
14
14
**
15
15
** You should have received a copy of the GNU General Public License
16
16
** along with this program; if not, write to the Free Software
17
17
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
18
**/
19
19
20
20
#ifndef ZABBIX_COMMS_H
21
21
#define ZABBIX_COMMS_H
22
22
23
-
#include "zbxtypes.h"
24
23
#include "zbxalgo.h"
25
24
26
25
#ifdef _WINDOWS
27
26
# define ZBX_TCP_WRITE(s, b, bl) ((ssize_t)send((s), (b), (int)(bl), 0))
28
27
# define ZBX_TCP_READ(s, b, bl) ((ssize_t)recv((s), (b), (int)(bl), 0))
29
28
# define zbx_socket_close(s) if (ZBX_SOCKET_ERROR != (s)) closesocket(s)
30
29
# define zbx_socket_last_error() WSAGetLastError()
31
30
# define zbx_bind(s, a, l) (bind((s), (a), (int)(l)))
32
31
# define zbx_sendto(fd, b, n, f, a, l) (sendto((fd), (b), (int)(n), (f), (a), (l)))
33
32