Hi, I am trying to get the "metadata" from ParaView by connecting to the socket. I'm having an issue where I am correctly sending the command to send the data but I'm not receiving the length value or string correctly. Below is my method how I am currently trying to get the length value:
// In the main program // command = 2; if(-1 == send(socket, &command, sizeof(command), 0)) exit(1); int size; unsigned long long length; if((size = Receive(socket, &length, sizeof(unsigned long long)) <= 0) exit(1); cout << size << endl; cout << length << endl; // Receive function // int Receive( cons int sk, void* data, int len) { char* buffer = reinterpret_cast<char*>(data); int total = 0; do { int nRecvd = recv(socket, buffered+total, len-total, 0); if(nRecvd == 0) { cout << "No Data Received" << endl; exit(1); } if(nRecvd == -1) { cout << "Error" << endl; exit(1); } total += nRecvd; }while(total < len); return total; } Now in the source code of the MobileSocketPlugin, I added a printf to show the value of "length" before it is sent over the socket. When I run my code, it succeeds without an error but the value of my "length" is not equal. For example, if I connect and run my code immediately after starting up ParaView, it always sends a value of "1733" but I receive a value of "7443178323969" every time. I'm really not sure what I need to change to get this correct. If someone could point me in the right direction on what I need to be doing to receive the metadata through MobileSocketPlugin, I would greatly appreciate it! Thanks, Travis J. Bueter ---------------------------------------------------------------------- Missouri University of Science and Technology - Junior B.S. Computer Engineering/Computer Science tjb...@mail.mst.edu<mailto:tjb...@mail.mst.edu> (573)-238-5843 IT RSS Treasurer - MS&T Robotics Competition Team ----------------------------------------------------------------------
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView Follow this link to subscribe/unsubscribe: http://www.paraview.org/mailman/listinfo/paraview