git-svn-id: svn://db.shs.com.ru/pip@623 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
56
main.cpp
56
main.cpp
@@ -27,11 +27,36 @@ public:
|
||||
EVENT_HANDLER(void, serverConnect) {
|
||||
piCout << "serverConnect OK!";
|
||||
}
|
||||
EVENT_HANDLER1(void, f, int, id) {
|
||||
piCout << "finished" << id;
|
||||
}
|
||||
};
|
||||
|
||||
class A: public PIObject {
|
||||
PIOBJECT(A)
|
||||
public:
|
||||
A() {}
|
||||
EVENT_HANDLER2(void, pcf, int, id, PIString*, buff) {
|
||||
piCout << "PICout(" << id << ") finished:" << (*buff);
|
||||
}
|
||||
};
|
||||
int main() {
|
||||
A a;
|
||||
CONNECTU(PICout::Notifier::object(), finished, &a, pcf);
|
||||
PIString buffer = "my buff:";
|
||||
PICout(&buffer, 1) << "int 10 ->" << 10 << ", time ->" << PITime::current();
|
||||
return 0;
|
||||
/*}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
piCout << "start";
|
||||
Obj o;
|
||||
CONNECTU(PICout::Notifier::object(), finished, &o, f);
|
||||
PIString s = "!!!";
|
||||
piCout << s;
|
||||
PICout(&s, 1) << "now" << PIDateTime::current() << ", int 1 =" << 1;
|
||||
piCout << s;*/
|
||||
|
||||
/*piCout << "start";
|
||||
PICrypt crypt;
|
||||
PIByteArray skey1, pkey1;
|
||||
crypt.generateKeypair(pkey1, skey1);
|
||||
@@ -62,29 +87,6 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
piCout << "=======================================";
|
||||
|
||||
PIAuth server(PIAuth::generateSign(pkey1));
|
||||
@@ -105,7 +107,7 @@ int main(int argc, char *argv[]) {
|
||||
client.startClient();
|
||||
ba = server.startServer();
|
||||
int st = PIAuth::AuthProbe;
|
||||
piCout << "server" << st << ba.toHex() << ba.size();
|
||||
piCout << "server" << st << ba.toHex() << ba.size();*/
|
||||
|
||||
|
||||
|
||||
@@ -128,7 +130,7 @@ int main(int argc, char *argv[]) {
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/*
|
||||
st = client.receive(ba);
|
||||
piCout << "client" << st << ba.toHex() << ba.size();
|
||||
st = server.receive(ba);
|
||||
@@ -144,7 +146,7 @@ int main(int argc, char *argv[]) {
|
||||
st = client.receive(ba);
|
||||
piCout << "client" << st << ba.toHex() << ba.size();
|
||||
st = server.receive(ba);
|
||||
piCout << "server" << st << ba.toHex() << ba.size();
|
||||
piCout << "server" << st << ba.toHex() << ba.size();*/
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user