Istream beginner help

ba_f ba_f at rbg.informatik.tu-darmstadt.de
Thu Jun 12 21:56:05 CEST 2014


Hallo Hackers,


for design reason i would like to use separate Istream & Ostream instead 
of IOstream with call().

ostream.send() does work, but i cant manage istream.receive(). It keeps 
waiting for ever.

I did edit the client from pkg/examples/clntsrv, the server sends the 
result, so there should be something to receive.
What am i missing?


// pkg/examples/clntsrv/myClient.cc

static L4::Cap<void> server;

static int func_neg_transmit()
{
   L4::Ipc::Ostream oStream(l4_utcb());

   l4_uint32_t val = 8;

   s << l4_umword_t(Opcode::func_neg) << val;
   int r = l4_error(s.send(server.cap(), Protocol::Calc));
}

static int getResult()
{
   L4::Ipc::Istream iStream(l4_utcb());

   l4_uint32_t val;

//  while ( iStream.has_more<l4_uint32_t>()) { // doesnt work neither
   int r = l4_error(iStream.receive(server.cap()));
   printf("receive success\n"); // doesnt pass here

   iStream >> val;
}

int main()
{
   server = L4Re::Env::env()->get_cap<void>("calc_server");

   func_neg_transmit();
   getResult();

   return 0;
}


THANK YOU




More information about the l4-hackers mailing list