RPC with LWIP
Mhamad Hmad
mhh.it1986 at ...9...
Thu Jun 26 20:46:03 CEST 2014
hi Norman ,
>>As for simplifying the scenario, I recommend you to take the RPC
>>interface out for now. Integrate both clients into a single program,
>>which also links against lwIP. Create a thread for each client and let
>>the thread call the respective "main" routine. When running the
>>resulting program, you should see the same behavior as now because two
>>threads are interacting with the lwIP stack.
what i want is to let the rpc server able to server two client( two echo
client for example) work in different ports. as you advice i remove the
RPC interface and did the next ,
- create server method which take the port number
as parameter to create echo server and listen to the given port
void *server (void *Sport)
{
....
}
- in the main method i great two threads and supply each one with
different port,
- create the run file and them run the test
what i found that the both server ( threads) connect correctly and both of
them block at accept and that is the right action
while with using RPC one of them will block at the accept and the other
will wait .
from the client side i connect to the both server by telent each of them
and type message to them and it work smoothly.
so , I think without using the RPC we dont have the blocking problem or may
be my test was wrong .
i will attach the .run ,server.c and .mk files .
best,
2014-06-26 13:04 GMT+01:00 Norman Feske <norman.feske at ...1...>:
> Hi Mohammad,
>
> > thank you for your replay,
> > Acctually i am thinking in using the second option by making the server
> > multi-threaded (using one entrypoint per session). but in this case i
> > am facing the problem that the RPC has its own schedule and the LwIP
> > also has it is own one too . So in one case i will have that the RPC
> > waiting in one point and the LWIP waiting in different place so isthere
> > any way to try to combine the both wait points in one .
>
> I am afraid that this information is too vague to give to meaningful
> advice.
>
> To find out at where your program gets stuck, I have two
> recommendations: Simplify your scenario and move the scenario to Linux
> to inspect it with GDB.
>
> As for simplifying the scenario, I recommend you to take the RPC
> interface out for now. Integrate both clients into a single program,
> which also links against lwIP. Create a thread for each client and let
> the thread call the respective "main" routine. When running the
> resulting program, you should see the same behavior as now because two
> threads are interacting with the lwIP stack.
>
> Moving the scenario to Linux will enable you to closely inspect what is
> going on. Each Genode thread will be a Linux thread. You can see all the
> threads using 'ps -eLf' and attach to each of them via 'gdb -p <thread
> ID>'. This way, you get a good overview of the situation when it hangs.
> For running your networking test on Linux, you can use the NIC driver at
> 'os/src/drivers/nic/linux', which uses a tap device. For more
> information about setting up networking using a tap device, please refer
> to the following descriptions:
>
>
>
> http://www.genode.org/documentation/release-notes/10.02#NIC_driver_for_Linux
> http://genode.org/documentation/release-notes/10.05#Arora_web_browser
>
> You may also take the run script at 'libports/run/lwip_lx.run' as
> reference. It starts a little HTTP server. On startup, it prints its IP
> address, which you can use as URL in your browser.
>
> Best regards
> Norman
>
> --
> Dr.-Ing. Norman Feske
> Genode Labs
>
> http://www.genode-labs.com · http://genode.org
>
> Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
> Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20140626/a306e3ed/attachment.html>
-------------- next part --------------
TARGET = test-echo_server_3
LIBS = lwip libc_log base libc libc_lwip_nic_dhcp libc_lwip pthread
SRC_CC = server.c
OPT_CC =-w
-------------- next part --------------
A non-text attachment was scrubbed...
Name: server.c
Type: text/x-csrc
Size: 2359 bytes
Desc: not available
URL: <http://lists.genode.org/pipermail/users/attachments/20140626/a306e3ed/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.run
Type: application/octet-stream
Size: 2761 bytes
Desc: not available
URL: <http://lists.genode.org/pipermail/users/attachments/20140626/a306e3ed/attachment.obj>
More information about the users
mailing list