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

📄 gs.cpp

📁 Sector is a system infrastructure software that provides functionality for distributed data storage,
💻 CPP
字号:
#include <gmp.h>#include <message.h>#include <iostream>using namespace std;using namespace cb;int main(){   cb::CGMP gmp;   gmp.init(6000);   char ip[64];   int port;   CUserMessage msg;   int32_t id;   char* res = "got it.";   strcpy(msg.m_pcBuffer, res);   msg.m_iDataLength = strlen(res) + 1;   while (true)   {      gmp.recvfrom(ip, port, id, &msg);      cout << "RECV " << ip << " " << port << " " << id << " " << msg.m_pcBuffer << " " << msg.m_iDataLength << endl;      strcpy(msg.m_pcBuffer, res);      msg.m_iDataLength = strlen(res) + 1;      gmp.sendto(ip, port, id, &msg);      cout << endl << endl;   }   return 1;}

⌨️ 快捷键说明

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