X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/3de68addc94548e2191d83b7aa4ebec21957391e..9ee7a97ec97d3dc41e1367f1f457d5ed5d5270ea:/practicas/pipi/src/test_recv.cpp?ds=inline diff --git a/practicas/pipi/src/test_recv.cpp b/practicas/pipi/src/test_recv.cpp index b77b5f8..fb8be43 100644 --- a/practicas/pipi/src/test_recv.cpp +++ b/practicas/pipi/src/test_recv.cpp @@ -1,7 +1,5 @@ -#include "ethernetframe.h" -#include "media.h" -#include "dev.h" +#include "devque.h" #include #include #include @@ -11,16 +9,14 @@ int main() { - Media media(0xabcdef); - Dev dev(1234, media); + DevQue dev(4321); struct msqid_ds minfo; - for (msgctl(media.que_id, IPC_STAT, &minfo); minfo.msg_qnum; - msgctl(media.que_id, IPC_STAT, &minfo)) + for (msgctl(dev.que_id, IPC_STAT, &minfo); minfo.msg_qnum; + msgctl(dev.que_id, IPC_STAT, &minfo)) { std::cout << "Quedan " << minfo.msg_qnum << " mensajes en la cola\n"; - EthernetFrame<1500> f(1234); - dev.recv(f); - std::cout << f._mac << " " << f._len << " " << f._frame << "\n"; + std::string s = dev.receive(); + std::cout << "Recibido '" << s << "' (len " << s.size() << ")\n"; } return 0; }