Hi
I want to transfer some data (a python list of list of different dimensions) using udp echo (client server)
example.
Using a given sample code in example (copied below), I can send the data for normal cases like hellow world or simple array. To send a list of list of different dimensions (e.g. [ [1,2,3,4], [1,2] ]). I cannot use these examples. I tried converting list to string and then transfer to server, but on receiver end, the integrity of list structure is disturbed and i can get indivual characters of the string. Sample is below.
I understand it is more like a python problem, but in ns3, is there a way to send this list as file using tcp or udp or any other simple way.
##########################
client.SetFill (apps.Get (0), "Hello World");
client.SetFill (apps.Get (0), 0xa5, 1024);
uint8_t fill[] = { 0, 1, 2, 3, 4, 5, 6};
client.SetFill (apps.Get (0), fill, sizeof(fill), 1024);
##########################
Thank you
Asif
actual data sent
'[array([[-0.45, -0.433, 0.64,\n 0.21, 0.18 ,\n -0.29 , 0.04],\n [-0.41, 0.36, 0.35,\n 0.09, 0.38 ,\n 0.30, -0.10] ]], dtype=float32), array([-0.83 , 0. , -0.40, 0.95 , 1.11 ,\n 0.21, -0.29, 0. , -0.42 , -1.16 ,\n 0.93 , 0.55 ], dtype=float32))]'
data is received at server and then tried to convert from string to list
['[',
'a',
'r',
'r',
'a',
'y',
'(',
'[',
'[',
'-',
'0',
'.',
'4',
'5',
',',