Aw: [En-Nut-Discussion] httpd + thread

ea.genzel at arcor.de ea.genzel at arcor.de
Wed Sep 14 12:41:59 CEST 2005


I had similar difficulties - increase your stacksize !

Andreas 


----- Original Nachricht ----
Von:     Anpilogov Andrey <def at fea.kiev.ua>
An:      en-nut-discussion at egnite.de
Datum:   14.09.2005 12:32
Betreff: [En-Nut-Discussion] httpd + thread

> Hi all!!!
> I modified an example httpd and has added such thread:
> THREAD(TCPClient, arg)
> {
>     TCPSOCKET *sock;
>     FILE *stream;
>     char buff[128];
> 
>     for (;;) {
>         if ((sock = NutTcpCreateSocket()) != 0) {
> //            if (NutTcpConnect(sock, 
> inet_addr(Conf.server_ip),Conf.server_port) == 0) {
> //                if ((stream = _fdopen((int) sock, "r+b")) != 0) {
>                     NutSleep(15000);
> //                    fclose(stream);
> //                } else
> //                    puts("Assigning a stream failed");
> //            } else
> //              puts("failed");
>             NutTcpCloseSocket(sock);
>         }
>         NutSleep(1000);
>     }
> }
> 
> I start thus:
> NutThreadCreate("tcp", TCPClient, 0, 192);
> All works normally, but when I try to open CGI script device rebooted. 8 (
> 
> Someone collided with such problem?
> Or, probably, I do something not correctly?
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> 



More information about the En-Nut-Discussion mailing list