Hi,
I built small test server application using lwip stack  to work like echo
server .
i tried to associate the socket with a stream by using fdopen but it failed
.
when i using the mode "r" or "r+" it give invalid parameter error,
in the same time when i try to write on the file descriptor returned by
lwip_accept  it is write to the client .
the part of code is :
while (1)
{
magsock = lwip_accept (socket_v , 0, 0 );
if (magsock ==-1)
    {
         perror ("lwip_accept");
    }
else
    {
        // this is work
        char *buf= "hi";
        if(  write (,magsock,buf , sizeof(buf) )<0)
           {
                perror ("write");
            }
        // this is not work
        FILE *file;
        file= fdopn(magsock ,"r");
        if (file==NULL)
           {
                perror ("fdopn");

           }
        int c ;
        while(c=fgetc(file))
               printf(c);
        fclose(file);
    }
}
any clue or suggestion ?

best,
--
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Genode-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/genode-main

Reply via email to