⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netif.h

📁 1999年卡耐基梅陇大学的2D仿真源代码
💻 H
字号:
/* -*- Mode: C++ -*- *//* netif.h * CMUnited99 (soccer client for Robocup99) * Peter Stone <pstone@cs.cmu.edu> * Computer Science Department * Carnegie Mellon University * Copyright (C) 1999 Peter Stone * * CMUnited-99 was created by Peter Stone, Patrick Riley, and Manuela Veloso * * You may copy and distribute this program freely as long as you retain this notice. * If you make any changes or have any comments we would appreciate a message. * For more information, please see http://www.cs.cmu.edu/~robosoccer/ *//* * Definitions for UDP c/s program. */#ifndef __netif_h#define __netif_h#include <stdio.h>#include <string.h>#include <unistd.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/file.h>#include <netinet/in.h>#include <arpa/inet.h>#include <netdb.h>#include <fcntl.h>#include <errno.h>#include <signal.h>#include <sys/wait.h>#define DEFAULT_PORT_NUMBER	6000#define MAXMESG			2048#define MAXARG			200#ifdef MEMSET#define bzero(a, b) memset(a, 0, b)#endif#ifndef Linuxextern "C" void usleep(unsigned long);#endif#ifdef __cplusplusclass Socket { public:  int			socketfd  ;  struct sockaddr_in	serv_addr ;};#elsetypedef struct socket{    int			socketfd  ;    struct sockaddr_in	serv_addr ;}Socket ;#endifextern Socket init_connection(char* host, int port) ;extern int    send_message(char* buf, Socket *sock) ;extern int    receive_message(char *buf, Socket *sock) ;extern void   close_connection(Socket *sock) ;int wait_message(char *buf, Socket *sock);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -