Macros | Functions
network.cc File Reference
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netinet/tcp.h>
#include <sys/ioctl.h>
#include "xarm/core/os/network.h"
Include dependency graph for network.cc:

Go to the source code of this file.

Macros

#define DB_FLG   "[net work] "
 
#define PERRNO(ret, db_flg, str)
 
#define PRINT_ERR   printf
 

Functions

int socket_connect_server (int *socket, char server_ip[], int server_port)
 
int socket_init (char *local_ip, int port, int is_server)
 
int socket_send_data (int client_fp, unsigned char *data, int len)
 

Macro Definition Documentation

#define DB_FLG   "[net work] "

Definition at line 38 of file network.cc.

#define PERRNO (   ret,
  db_flg,
  str 
)
Value:
{ \
if (-1 == ret) { \
PRINT_ERR("%s%s, errno=%d\n", db_flg, str, errno); \
return -1; \
} \
\
}
#define PRINT_ERR
Definition: network.cc:39

Definition at line 51 of file network.cc.

#define PRINT_ERR   printf

Definition at line 39 of file network.cc.

Function Documentation

int socket_connect_server ( int *  socket,
char  server_ip[],
int  server_port 
)

Definition at line 234 of file network.cc.

int socket_init ( char *  local_ip,
int  port,
int  is_server 
)

Definition at line 190 of file network.cc.

int socket_send_data ( int  client_fp,
unsigned char *  data,
int  len 
)

Definition at line 245 of file network.cc.



xarm_api
Author(s):
autogenerated on Sat May 8 2021 02:51:23