Dear all,
I have reviewed available examples for the client server based applications. Unfortunately could not find any example for which a client sends a char array to the server side. Each time the client sends a request and the server shares the data. Would it be possible to find an example for that?
For instance in the streammap example, the clients does the following (writes basic protocal and message tag to the UTCB and waits for the stream from the server would it be possible for the client to perform the stream whereas the server waits for the input?:
s << l4_umword_thttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga1c2c4b333f75b1d05b59855910f2b9cb (Opcode::Do_map) << (l4_addr_thttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4 )addr; s << L4::Ipc::Rcv_fpage::mem((l4_addr_thttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4)addr, L4_PAGESHIFThttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__memory__api.html#gad2f7e71d6265b2735f730dc90c54539a, 0);
The server on the other hand gets the protocol and base adress and then does the streaming: l4_addr_thttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4snd_base; ios >> snd_base; // put something into the page to read it out at the other side snprintf(page_to_map, sizeof(page_to_map), "Hello from the server!"); printf("Sending to client\n"); // send page ios << L4::Ipc::Snd_fpage::mem((l4_addr_thttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4)page_to_map, L4_PAGESHIFThttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__memory__api.html#gad2f7e71d6265b2735f730dc90c54539a , L4_FPAGE_ROhttp://os.inf.tu-dresden.de/L4Re/doc/group__l4__fpage__api.html#gga5d4f4972d58f72b2a33b6c139b5950a8a555326b01b4fe72916157bdc90307691, snd_base)
Hi,
Am 27.01.2014 15:03, schrieb Ajith Whowe:
Dear all,
I have reviewed available examples for the client server based applications. Unfortunately could not find any example for which a client sends a char array to the server side. Each time the client sends a request and the server shares the data. Would it be possible to find an example for that?
For instance in the streammap example, the clients does the following (writes basic protocal and message tag to the UTCB and waits for the stream from the server would it be possible for the client to perform the stream whereas the server waits for the input?:
s << l4_umword_t http://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga1c2c4b333f75b1d05b59855910f2b9cb(Opcode::Do_map) << (l4_addr_t http://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4)addr;
Just insert the following line here:
s << "message from client";
s << L4::Ipc::Rcv_fpage::mem((l4_addr_t http://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4)addr, L4_PAGESHIFT http://os.inf.tu-dresden.de/L4Re/doc/group__l4__memory__api.html#gad2f7e71d6265b2735f730dc90c54539a, 0);
The server on the other hand gets the protocol and base adress and then does the streaming: l4_addr_t http://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4 snd_base; ios >> snd_base;
and insert here:
unsigned long len; char buf[100]; len = sizeof(buf); ios >> L4::Ipc::Buf_cp_in<char>(buf, len); buf[len]='\0'; printf ("Received from client: %s\n", buf);
// put something into the page to read it out at the other side snprintf(page_to_map, sizeof(page_to_map), "Hello from the server!"); printf("Sending to client\n"); // send page ios << L4::Ipc::Snd_fpage::mem((l4_addr_t http://os.inf.tu-dresden.de/L4Re/doc/group__l4__basic__types.html#ga4087b991c40c0d2fcde9ca331049a4d4)page_to_map, L4_PAGESHIFT http://os.inf.tu-dresden.de/L4Re/doc/group__l4__memory__api.html#gad2f7e71d6265b2735f730dc90c54539a, L4_FPAGE_RO http://os.inf.tu-dresden.de/L4Re/doc/group__l4__fpage__api.html#gga5d4f4972d58f72b2a33b6c139b5950a8a555326b01b4fe72916157bdc90307691, snd_base)
l4-hackers@os.inf.tu-dresden.de