[En-Nut-Discussion] Newbie question: TCP Client

Przemyslaw Rudy prudy at audiotech.pl
Thu Oct 27 14:43:22 CEST 2005


Hi,
I have an opposite but similar problem.
I modified the httpd example disabling dhcp, so NutNetIfConfig() and
NutIpRouteAdd() are used instead.
I can access the www example page from within the local net. But having
a router between the PC and the nut board I am getting timeouts.
I did not test the network traffic with the ethereal yet.
Considering both problems is it possible that there is something wrong
with default gateway/arp usage?

Regards
Przemek


Guborev Sergei wrote:

> Hello Nuts!
> 
> I'm currently working on simple TCP client application and it seemed to be very tricky problem for me.
> I have dedicated IP address, remote server and ... Ethernut board, of course ( OS version 3.9.8 ).
> When I implemented TCP server on Ethernut it was totally ok. Connections, sending data, all were good. But when I try to use board as client, i.e. connect to remote host it's usually failed with "Host is down" or "Operation timed out" error. But host is definitly working. Other devices has no problem to communicate with it. These are some parts of my code:
> 
> #define MASK "255.255.255.0"
> #define MY_IP x.x.x.x
> #define MY_GATE x.x.x.x
> #define REMOTE_HOST x.x.x.x
> #define MY_MAC ...
> 
> NutRegisterDevice(&devDebug0, 0, 0);
> ...    
> NutRegisterDevice(&DEV_ETHER, 0x8300, 0);
> NutNetIfConfig( "eth0", MY_MAC, inet_addr( MY_IP ), inet_addr( MASK ) );
> NutIpRouteAdd( 0, 0, inet_addr( MY_GATE ), &DEV_ETHER);
> 
> sock = NutTcpCreateSocket();
>     
> NutTcpConnect( sock, inet_addr( REMOTE_HOST ), port );
> 
> Any suggestions? 
>                 With best regards, Sergei
> _______________________________________________
> 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