Active close vs passive close
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: Active close vs passive close
by hjjeon0608 ·
Hi, thierrydollar.
If you command close, it is active close.
If you receive FIN packet, it is passive close.
Best regards.
RE: Active close vs passive close
by jameskim ·
Hi thierrydollar,
I’d like add some explanation to above reply.
As you know, socket close happens by 3 way handshake.
When any device A requests to close the specific socket first, we call it Device A does [color=#FF0000]ACTIVE CLOSE[/color].
When any device B, which communicates with or stays in idle, receives FIN packet from its peer, we call it Device B does [color=#FF0000]PASSIVE CLOSE[/color].
We can just call close() function in sock_established status, for active close.
Otherwise, if the status of its corresponding socket changed to sock_closewait, this means your device received FIN packet from its peer.
Your device is already in passive close stage.
In this case, if you don’t have any data to be processed then call close().
It makes that socket closed gracefully.
I hope my post will help you.
Thanks.
javakys.