[go: up one dir, main page]

Menu

[r65]: / gmp / gc.cpp  Maximize  Restore  History

Download this file

40 lines (25 with data), 614 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <gmp.h>
#include <message.h>
#include <unistd.h>
#include <iostream>
using namespace std;
using namespace cb;
int main()
{
cb::CGMP gmp;
gmp.init(7000);
cout << "TEST " << gmp.rtt("127.0.0.1", 6000) << endl;
CUserMessage req, res;
req.m_iDataLength = 2000;
int32_t id;
while (true)
{
id = 0;
gmp.sendto("127.0.0.1", 6000, id, &req);
gmp.recv(id, &res);
cout << "response: " << id << " " << res.m_pcBuffer << " " << res.m_iDataLength << " " << gmp.rtt("127.0.0.1", 6000) << endl;
sleep(1);
cout << endl << endl;
}
return 1;
}