AW: AW: [En-Nut-Discussion] TCP Error No. 10057

Ing. Joachim Skale joachim.skale at tele2.at
Wed Jan 25 14:15:43 CET 2006


hi harald, 

there is no required external Hardware to test my software, therefore i use DEFINES.

my problem is a little bit complex so i cant use simple software !

Overwriting the local TCP Port my not be the best idea, but it was for testing.

i have a code running under WIN32 stable, but i don't want to port it to Nut/OS.
but now i think this will be the fastest and best way to get it stable.


Joachim

-----Ursprungliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Harald Kipp
Gesendet: Mittwoch, 25. Janner 2006 13:50
An: Ethernut User Chat (English)
Betreff: Re: AW: [En-Nut-Discussion] TCP Error No. 10057


Hi Joachim,


>i used ethereal to get more infos about my problem, and i saw that my peer 
>sends the data, ethernut tried to receive, but at this
>point ethernut closed the connection.
>
>i dont have any ideas what i can do to prevent this error.
>
>if my source will help anyone, i can send it directly.

Well, the problem is that your code is complex, consisting of
several thousand lines of code, running 4-5 threads, containing
several compile options and requires some external hardware to
test it.

If you think, that Nut/OS causes the problem, please setup a
simple sample that demonstrates the problem.

Beside other things when checking your code I stumbled over
things like

                 if ((sock = NutTcpCreateSocket()) != 0) {
                         sock->so_local_port = 1047;
                         if (NutTcpConnect(sock, tcpsrv_adress, srv_port) 
== 0) {

I do not think it's a good idea to override the local port
chosen by Nut/Net. Furthermore I can't find where you close
a socket after a connection close, except:

                 if ((sock = NutTcpCreateSocket()) != 0) {
...code removed...
                 }
                 else {
                         printf("Error creating Socket\n");
                         NutTcpCloseSocket(sock);
                         NutTcpDestroySocket(sock);
                 }

which looks completely wrong to me. If NutTcpCreateSocket fails,
you should not use sock anymore, not even for closing.

I'm sorry, but my conclusion is, that Nut/OS is fine and your
application is buggy. At least as long as no one demonstrates
that I'm wrong. :-)

I'd recommend to try the code on the PC first (Win32 or Linux).
There are much better possibilities for testing available. As
soon as this works reliable on the PC, it's usually a snap to
port it to Nut/OS, replacing beginthread() by NutThreadCreate(),
send() by NutTcpTransmit() etc.

Harald





_______________________________________________
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