[SOLVED] W5100 Sn_CR_DISCON Time
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: [SOLVED] W5100 Sn_CR_DISCON Time
by Eugeny ·
You do not have to wait. DISCON sends special packet to the remote network device that server terminates the connection. Server is a master here, thus after this DISCON packet is sent, server can close the connection and set itself to wait for another connection.
You try to do everything properly from your standpoint, waiting for the confirmation of the remote device disconnecting. In general what may happen is that remote device having these 8 seconds of timeout in its TCP protocol engine, and checks incoming packets with this frequency. Thus after 8 seconds elapses it sees DISCON packet and sends confirmation packet to the server. But server actually does not need it.
The one thing which I am curious about is if you do this way - disconnect, then immediately close and set into listening mode - and in 8 seconds remote peer awakes with DISCON confirm packet, will W5100 raise the interrupt? And you can easily check it. I do not think it will be a problem because W5100 will discard the packet as connection is closed.
RE: [SOLVED] W5100 Sn_CR_DISCON Time
by Kebims ·
Thank for your reply Eugeny.
It’s work fine !
I send the disconnect command and immediately, I re-create my server and I go to listen mode.
Effectively, when I do this, I don’t have disconnect interrupt but I don’t need it.
Thank you again.
RE: [SOLVED] W5100 Sn_CR_DISCON Time
by Gunther17 ·
HI everybody,
I am working at the ssame Problem, but I am not so deeply used to the W5100. What procedure do yo recommend? First if the S0SR goes to CLOSE_WAIT, I set the S0CR to CR_DISCONN. Then I wait for the S0SR to go to SOCK_CLOSED state. Could I skip timeout if I see the S0SR goes to SOCK_LAST_ACK, and then set the S0CR to CR_CLOSE?
Thanks a lot
Guenther