X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=iotjava%2Fiotrmi%2FC%2B%2B%2FIoTSocketClient.cpp;fp=iotjava%2Fiotrmi%2FC%2B%2B%2FIoTSocketClient.cpp;h=0000000000000000000000000000000000000000;hb=ffea2cb68e5a2e1bac041fe2279620eba8d227f8;hp=ce9f0a5d9e5927b6881dd7e2adc871b654016b08;hpb=e9a65a3fa878d7451ceb4f5a2cb1bc9ee846e035;p=iot2.git diff --git a/iotjava/iotrmi/C++/IoTSocketClient.cpp b/iotjava/iotrmi/C++/IoTSocketClient.cpp deleted file mode 100644 index ce9f0a5..0000000 --- a/iotjava/iotrmi/C++/IoTSocketClient.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include -#include -#include "IoTSocketClient.hpp" - -using namespace std; - -#define SIZE 10 /* how many items per packet */ -#define NUM_PACKS 3 /* number of times we'll do it */ - -int main(int argc, char *argv[]) -{ - char D[SIZE]; - - /* if no command line arguments passed, we'll default to - these two port number */ - int port = 5010; - int rev = 0; - bool bResult = false; - - fflush(NULL); - IoTSocketClient mylink(port, "127.0.0.1", rev, &bResult); - - if (!bResult) - { - printf("Failed to create Client object!\n"); - return 0; - } - - printf("Client, made connection...\n"); - fflush(NULL); - - /* put some dummy data in our arrays */ - - for (int i = 0; i < SIZE; i++) - { - D[i] = i; - } - - for (int i = 0; i < NUM_PACKS; i++) - { - printf("Client, receiving bytes, iteration %d\n", i); - fflush(NULL); - mylink.receiveBytes(D); - } - - char str[50]; - char* str2; - fflush(NULL); - str2 = mylink.receiveBytes(str); - string s(str2); - cout << "Received text: " << s << endl; - - printf("Client, closing connection...\n"); - fflush(NULL); - mylink.close(); - - printf("Client, done...\n"); - fflush(NULL); - return 0; -}