[En-Nut-Discussion] Connection reset when trying to connect
Martin Kresse
m.kresse at cut5-systemhaus.de
Sun Oct 12 06:30:26 CEST 2003
Hi there,
I want my ethernut to establish a tcp connection to a server (my PC),
that might not always be available. If the serving application is
already running when I try to connect via NutTcpConnect(), the
connection will be established and everything works just fine.
However, if I start the service after the ethernut is already trying to
connect to it (in a loop), something strange happens on the server side
(which is actually a Java application). The blocking accept() call
returns, I get a Socket object that represents the connection to my
ethernut and it looks like the connection is established. But
NutTcpConnect() is still blocked (it will eventually return with -1 and
tcp error set to ECONNREFUSED) and when I try to read or write to the
socket (on the serverside), I get a socket exception "Connection reset".
I know this sounds like a Java problem and this is not a Java forum, but
I am pretty sure that Java's underlying implementation is correct (as
are my 5 lines of code), and that the problem lies somwhere within Nut/Net.
Does anyone have any idea what might be the problem and how to avoid a
real ugly workaround on the server side?
Sincerely,
Martin Kresse
More information about the En-Nut-Discussion
mailing list