On client, send the object just like you would send any other blob, then on client recreate it from the blob. Probably something like below. Make sure the class has an overloaded = operator for this to work.
send(socketID, &object, sizeof(MyClass));
// this isn't going to be technically accurate, but gives you the idea.
unsigned char* buf = recv(sucketID);
MyObject object = *(MyObject*)buf;
text is a universal format; it is easy for people to read, write, and edit.
and the network payload is easier to inspect, to modify and to debug.
text data is transparent and help enforce encapsulation between programs.
a textual protocol tends to future-proof your system. one reason is that ranges on numeric fields, padding of members and endianness aren't implied by the format itself. on the other hand, binary formats are platform specific and are difficult to extend.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.