TCP Server/Client Mode 문의
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: TCP Server/Client Mode 문의
by hjjeon0608 ·
안녕하세요.
TCP의 경우 disconnect를 할 경우 4 way handshake 과정을 거치게 됩니다. 즉, FIN packet과 ACK를 주고 받아야지 close상태로 바뀝니다. 그래서 제 생각에는 client에서 close(단순 close가 아니라 disconnect일 경우)한 후 바로 connect 요청시 연결이 안되는 것으로 판단됩니다. 정확한 것은 wireshark같은 패킷캡쳐 프로그램으로 분석해 보시면 될 겁니다.
즉, CLOSE_WAIT 상태에서 빠져나와 listen상태로 가기 전에 connect 요청을 보내서 fail이 난것이 아닐까 생각 됩니다.
빠른 close를 원하신다면 상대방에서 disconnect요청이 들어 왔을 경우 disconnect가 아니라 바로 close 이후 약 10ms딜레이를 준다음 socket을 재 open 해도 무방합니다만, CLOSE_WAIT상태는 half close상태로 상대방이 보낸 패킷이 있다면 이를 모두 처리한 이후에 close를 하게 됩니다. 이 과정이 필요 없으시다면 close를 해도 됩니다.
감사합니다.