亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? server.hh

?? 一個機器人平臺
?? HH
字號:
// server.hh// RTV 23 May 2002//// Class provides a network server for Stage internals// used by external GUIs (XS) and distributed Stage modules//// $Id: server.hh,v 1.9 2002/11/11 03:09:46 rtv Exp $#ifndef _SERVER_H#define _SERVER_H#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <errno.h>#include "replace.h" // for poll(2)#include "player.h" // from player#include "stage_types.hh"#include "worldfile.hh"#include "world.hh"#include "library.hh"typedef	struct sockaddr SA; // useful abbreviation// the server reads a header to discover which type of data follows...enum HeaderType { PosePackets, 		  EntityPackets, 		  PropertyPackets, 		  EnvironmentPackets,		  MatrixPacket,		  BackgroundPacket,		  PixelPackets, 		  Continue, 		  ContinueTime, 		  StageCommand,		  DownloadComplete};typedef struct{  HeaderType type; // see enum above  // the meaning of the data field varies with the message type:  // for _Packets types, this gives the number of packets to follow  // for Command types, specifies the command  // for Continue types, is not used.  uint32_t data;   } __attribute ((packed)) stage_header_t;// COMMANDS - no packet follows; the header's data field is set to one// of theseenum cmd_t { SAVEc = 1, LOADc, PAUSEc, DOWNLOADc, SUBSCRIBEc };// this allows us to set a property for an entity// pretty much any data member of an entity can be set// using the entity's ::SetProperty() methodtypedef struct{  uint16_t id; // identify the entity  EntityProperty property; // identify the property  uint16_t len; // the property uses this much data (to follow)} __attribute ((packed)) stage_property_t;// a client that receives this packet should create a new entitytypedef struct{  int32_t id;  int32_t parent;  //StageType type;  char token[ STAGE_TOKEN_MAX ];} __attribute ((packed)) stage_entity_t;// a client that receives this packet should create a matrixtypedef struct{  int32_t sizex;  int32_t sizey;} __attribute ((packed)) stage_matrix_t;//TODO - this is out of date nowtypedef struct{  int32_t sizex;  int32_t sizey;  double scale;} __attribute ((packed)) stage_background_t;// pose changes are so common that we have a special message for them,// rather than setting the [x,y,th] properties seperately. i've taken// out the parent_id field for compactness - you must set that// property directly - it doesn't happen too often anywaytypedef struct{  int16_t stage_id;  // i changed the x and y to signed ints so that XS can handle negative  // local coords -BPG  int32_t x, y; // mm, mm   int16_t th; // degrees} __attribute ((packed)) stage_pose_t;// TODO-  some more special messages to cut down on the property changes//// this class extends CWorld with a bunch of read/write functions.// it is never instantiated, but subclassed by Client and Serverclass CStageIO : public CWorld{private:  public:  // simple constructor  CStageIO( int argc, char** argv, Library* lib );  virtual ~CStageIO( void );  // THIS IS THE EXTERNAL INTERFACE TO THE WORLD, SHARED BY ALL WORLD  // DESCENDANTS  virtual int Read( void );  //virtual void Update( void );  virtual void Write( void );  //virtual void Shutdown( void );protected:  ///////////////////////////////////////////////////////////  // IO data  int m_port; // the port number of the server server   protected: bool m_external_sync_required;  // the number of synchronous pose connections  int m_sync_counter;   // flag is unset when a DownloadComplete packet is received  bool m_downloading;   // poll data for each pose connection  struct pollfd m_pose_connections[ MAX_POSE_CONNECTIONS ];  // subsciption data for each connection   char m_dirty_subscribe[ MAX_POSE_CONNECTIONS ];  // record the type of each connection (sync/async)   char m_conn_type[ MAX_POSE_CONNECTIONS ];    // the number of pose connections  int m_pose_connection_count;  protected: int CountDirtyOnConnection( int con );    // sets the dirty flag on all entities  public: void DirtyEntities( void )    { CWorld::root->SetDirty( 1 ); }  // unsets the dirty flag on all entities  public: void CleanEntities( void )    { CWorld::root->SetDirty( 0 ); }  // dirty all entities for a particular connection  public: void DirtyEntities( int con )    { CWorld::root->SetDirty( con, 1 ); }  // clan all entities for a particulat connection  public: void CleanEntities( int con )    { CWorld::root->SetDirty( con, 0 ); }  // called when a connection's fd looks bad - closes the  // fd and tidies up the connection arrays  void DestroyConnection( int con );  // acts on commands  void HandleCommand( int con, cmd_t cmd );  // if player has changed the subscription count, we make the property dirty  void CheckForDirtyPlayerSubscriptions( void );  // these are the basic IO fucntions  int ReadPacket( int fd, char* buf, size_t len );  int WritePacket( int fd, char* buf, size_t len );    // these are wrappers for the packet functions  // with useful size checks and type conversions  int ReadHeader( int fd, stage_header_t* hdr  );  int ReadProperty( int fd, stage_property_t* prop, 		    char* data, size_t len );  int ReadEntity( int fd, stage_entity_t* ent );  int ReadMatrix( int fd );  int ReadBackground( int fd );  int WriteHeader( int fd, HeaderType type, uint32_t data );    int WriteCommand( int fd, cmd_t cmd );  int WriteProperty( int fd, stage_property_t* prop, 		     char* data, size_t len );  int WriteEntity( int fd, stage_entity_t* ent );  int WriteMatrix( int fd );  int WriteBackground( int fd );  int WriteSubscriptions( int fd );  // these call the above functions multiple times, Getting and  // Setting the properties of the entities, etc.  int ReadProperties( int con, int fd, int num );  int ReadEntities( int fd, int num );  int WriteEntities( int fd );};class CStageServer : public CStageIO{  public:  CStageServer( int argc, char** argv, Library* lib );  virtual ~CStageServer( void );    // THIS IS THE EXTERNAL INTERFACE TO THE WORLD, SHARED BY ALL WORLD  // DESCENDANTS  virtual int Read( void );  // check to seee what player has done, then inherits parent's Write()  virtual void Write( void );  virtual void Update( void );  //virtual bool Startup( void );  //virtual void Shutdown( void );    ////////////////////////////////////////////////////////////////////  // CONFIGURATION FILE   private: char worldfilename[STAGE_WORLD_FILENAME_MAX];    // parse and set configs from the argument list  private: bool ParseCmdLine( int argc, char** argv );  // Load the world file  private: virtual bool Load( void );  // Save the world file  private: virtual bool Save( void );  // Initialise the world  public: virtual bool Startup();    // Shutdown the world  public: virtual bool Shutdown();    ///////////////////////////////////////////////////////////////////  // SERVER STUFF  // data for the server-server's listening socket  struct pollfd m_pose_listen;  bool SetupConnectionServer( void );  void ListenForConnections( void );  bool start_disabled;  double Pause();  void StartTimer(double interval);  // when to shutdown (in seconds)private: int m_stoptime;public: int GetStopTime( void ){ return m_stoptime; };    /////////////////////////////////////////////////////////////////  // Player & interface  // Manage the single player instance  private: bool StartupPlayer( void );  private: void ShutdownPlayer( void );  // The PID of the one player instances  private: pid_t player_pid;    // flag controls whether Player is spawned - set on the command line  private: bool m_run_player;   // shared memory management for interfacing with Player  public: char* ClockFilename( void ){ return clockName; };  public: char* DeviceDirectory( void ){ return m_device_dir; };    private: char clockName[PATH_MAX]; // path of mmap node in filesystem  private: bool CreateClockDevice( void );private: int clock_lock_byte; // offset into the lock file controlling // access to the clock structure    // export the time in this buffer  protected: stage_clock_t* m_clock; // a timeval and lock  // override the CWorld time setting method  // we inherit the CWorld method, plus we set the external shared clock   // we return the new time in seconds  virtual double SetClock( double interval, uint32_t step_num );    // CREATE THE DEVICE DIRECTORY for external IO  private: bool CreateDeviceDirectory( void );  //////////////////////////////////////////////////////////////////////  // RECORD LOCKING   // device IO is protected by record locking a single byte of this  // file for each entity  // the filename of the lock file  private: char m_locks_name[PATH_MAX];// creates the file m_device_dir/devices.lock,  m_object_count bytes long  // stores the filename in m_locks_name and the fd in m_locks_fd  // the locks file descriptor  private: int m_locks_fd;    private: bool CreateLockFile( void );  virtual bool LockByte( int offset );  virtual bool UnlockByte( int offset );   //////////////////////////////////////////////////////////////////  // WHEN LINUX SUPPORTS PROCESS-SHARED SEMAPHORES WE'LL USE THEM AND  // SCRUB THE RECORD LOCKING - this code will make it happen...  // Create a single semaphore to sync access to the shared memory segments  //private: bool CreateShmemLock();  // Get a pointer to shared mem area  //public: void* GetShmem() {return playerIO;};      // lock the shared mem area  //public: bool LockShmem( void );  // Unlock the shared mem area  //public: void UnlockShmem( void );};class CStageClient : public CStageIO{public:  CStageClient( int argc, char** argv, Library* lib );  ~CStageClient( void );     // THIS IS THE EXTERNAL INTERFACE TO THE WORLD, SHARED BY ALL WORLD  // DESCENDANTS  //virtual int Read( void );  //virtual void Write( void );  virtual void Update( void );  //virtual void Shutdown( void );  // Initialise the world  public: virtual bool Startup();    // Shutdown the world  public: virtual bool Shutdown();   // download the world from the server  public: virtual bool Load( void );  // ask the server to save the world  public: virtual bool Save( void ); private:      int WriteCommand( cmd_t cmd )  { return CStageIO::WriteCommand( m_pose_connections[0].fd, cmd ); };  // the hostname of the machine we're connecting to  char m_remotehost[PATH_MAX];};#endif // _SERVER_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆成人久久精品二区三区小说| 高清不卡一区二区| 精品一区二区三区在线观看国产| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 日韩三级中文字幕| 1000精品久久久久久久久| 麻豆91在线播放| 欧美亚洲综合在线| 国产欧美日本一区二区三区| 日韩精品一二三区| 日本国产一区二区| 中文字幕av在线一区二区三区| 美女免费视频一区| 欧美午夜精品久久久久久超碰| 国产精品网友自拍| 国内欧美视频一区二区| 91精品国产综合久久蜜臀 | 成人午夜视频福利| 欧美精品一区二区久久婷婷| 亚洲国产sm捆绑调教视频| 国产成人午夜高潮毛片| 精品人在线二区三区| 日韩成人免费在线| 欧美午夜在线观看| 亚洲精品亚洲人成人网| 91免费国产在线观看| 国产精品少妇自拍| 成人黄色免费短视频| 国产欧美日韩精品a在线观看| 激情综合色综合久久| 日韩欧美色综合| 青娱乐精品在线视频| 制服丝袜日韩国产| 日韩**一区毛片| 69堂国产成人免费视频| 日本三级韩国三级欧美三级| 欧美二区三区91| 日韩综合一区二区| 91麻豆精品国产91久久久| 日韩国产一区二| 精品免费日韩av| 国产精品影视网| 中文字幕精品三区| 不卡欧美aaaaa| 亚洲美女一区二区三区| 91搞黄在线观看| 天天影视网天天综合色在线播放| 欧美另类变人与禽xxxxx| 日本女优在线视频一区二区| 日韩精品一区在线| 国产伦精品一区二区三区视频青涩| 精品国产99国产精品| 成人午夜精品一区二区三区| 自拍偷拍亚洲综合| 欧美日韩国产一区| 狠狠色丁香久久婷婷综合_中| 久久一区二区视频| 99国产欧美久久久精品| 性做久久久久久免费观看欧美| 在线播放一区二区三区| 黑人精品欧美一区二区蜜桃| 中文字幕一区二区三区精华液| 欧美亚洲尤物久久| 极品少妇xxxx精品少妇| 亚洲人123区| 日韩欧美在线综合网| 成人精品免费看| 午夜精品123| 国产清纯白嫩初高生在线观看91| 91美女福利视频| 麻豆精品视频在线| 亚洲人成在线观看一区二区| 91精品国产福利| 成人avav在线| 青青草伊人久久| 国产精品萝li| 欧美一级日韩一级| 91网站在线观看视频| 琪琪久久久久日韩精品| 日韩毛片在线免费观看| 日韩欧美一区二区三区在线| 色综合久久久久| 国产一区二区h| 亚洲1区2区3区4区| 亚洲欧美乱综合| 久久无码av三级| 7777精品伊人久久久大香线蕉超级流畅| 国产在线精品视频| 五月婷婷综合激情| 亚洲女人小视频在线观看| 日韩免费观看2025年上映的电影| 一本久久a久久免费精品不卡| 国产在线播放一区三区四| 午夜成人免费视频| 亚洲精品网站在线观看| 自拍偷拍亚洲综合| 久久久五月婷婷| 日韩视频在线观看一区二区| 欧美三级日韩三级| 色综合天天综合色综合av| 成人在线视频首页| 国产精品1024| 国内精品伊人久久久久av影院| 丝袜美腿成人在线| 亚洲午夜三级在线| 亚洲欧美激情小说另类| 日韩一区中文字幕| 国产精品人人做人人爽人人添| 欧美成人bangbros| 日韩欧美中文字幕精品| 678五月天丁香亚洲综合网| 日本久久电影网| 在线免费观看不卡av| 色综合欧美在线| 91久久精品日日躁夜夜躁欧美| 不卡区在线中文字幕| 成人福利视频网站| 成av人片一区二区| 94色蜜桃网一区二区三区| 北条麻妃国产九九精品视频| 成人av在线一区二区| 成人性生交大合| 成人激情动漫在线观看| 91在线免费看| 欧美色成人综合| 7777精品伊人久久久大香线蕉的 | 久久99久久久欧美国产| 久久av中文字幕片| 国产乱码字幕精品高清av| 国产精品亚洲人在线观看| 国产91清纯白嫩初高中在线观看 | 一本色道久久综合精品竹菊| 99麻豆久久久国产精品免费| 91美女蜜桃在线| 欧美老肥妇做.爰bbww| 日韩午夜中文字幕| 久久久久久久综合日本| 国产欧美一区二区三区沐欲| 中文字幕亚洲一区二区va在线| 一区二区三区在线不卡| 图片区日韩欧美亚洲| 久88久久88久久久| 成人av网在线| 欧美精品一级二级| 国产校园另类小说区| 亚洲三级在线观看| 麻豆国产精品视频| 99国产欧美久久久精品| 欧美精品一二三区| 中文文精品字幕一区二区| 一个色在线综合| 精品一区二区免费| 色综合久久天天| 欧美mv日韩mv国产网站app| 国产精品美女久久久久久久久久久| 亚洲欧洲日本在线| 美女一区二区久久| 99久久99久久精品免费看蜜桃| 欧美日韩一级二级| 中文字幕av免费专区久久| 视频在线观看一区| www..com久久爱| 精品国产一区二区精华| 一区二区三区欧美激情| 国产乱人伦精品一区二区在线观看| 91国产精品成人| 亚洲国产经典视频| 日本不卡视频在线| 97久久精品人人澡人人爽| 久久久久国产免费免费| 五月天激情小说综合| 99免费精品在线观看| 精品播放一区二区| 日本欧美在线观看| 欧美性大战久久久| 亚洲区小说区图片区qvod| 国产精品影音先锋| 欧美成人一区二区三区| 午夜精品久久久久久不卡8050| 本田岬高潮一区二区三区| 欧美精品一区二区三区在线| 日韩精品一级二级| 欧美无砖砖区免费| 亚洲欧美日韩国产另类专区 | 91在线视频官网| 中文字幕av不卡| 成人一区二区三区| 久久久久久97三级| 国产一区二区网址| 精品国产乱码久久久久久1区2区| 亚洲第一主播视频| 欧美日韩综合在线免费观看| 最新国产成人在线观看| 北条麻妃国产九九精品视频| 国产午夜久久久久| 高清久久久久久| 久久久久成人黄色影片| 久久精品99久久久| 日韩精品一区二区三区中文精品| 午夜精品久久一牛影视|