w5200 랜케이블 제거시 문제
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: w5200 랜케이블 제거시 문제
by jameskim ·
랜케이블을 제거 한다고 SOCK_ESTABLISHED 상태가 달라지는 것은 아닙니다.
랜케이블이 일시적으로 빠졌다가 다시 연결하였을 때 Socket을 close한다면 또 다른 문제가 발생하게 될 겁니다.
이런 경우에 사용하는 기능이 Keep alive 기능입니다.
Keep alive 기능은 상대방 소켓과 dummy data를 주고 받으면서 소켓 연결에 물리적, 논리적 문제가 있는 지를 확인하는 것입니다. 지정된 Keep alive timeout 시간 동안 dummy data 송수신이 이루어지지 않으면 소켓 연결이 사실상 끊어졌다고 보고 W5200 내의 해당 소켓을 강제로 close하면 위와 같은 문제를 해결할 수 있습니다.
RE: w5200 랜케이블 제거시 문제
by kilee ·
현재 저희 통신 방식이 서버에서 메시지 요청할 경우에만 클라이언트에서 응답하는 구조입니다.
따라서 서버에서 요청이 없을 경우에는 응답 하지 않고 대기 상태를 유지 합니다.
keep alive timeout이 클라이언트에서 메시지 보낼 경우에만 발생하는 것인가요?
저희와 같은 상황에서는 서버에서 일정시간 동안 요청이 없을 경우 강제로 소켓을 close하는 방법 밖에없나요?
RE: w5200 랜케이블 제거시 문제
by hjjeon0608 ·
timeout interrupt가 발생하면 status가 close로 바뀌게 됩니다.
또한 keep alive 뿐만 아니라 다른 패킷을 전송하더라도 lan 케이블이 연결이 되어 있지 않는다면 ack를 받지 못하므로 timeout interrupt가 발생하며 status가 close로 바뀌게 됩니다.
dummy 패킷을 보내거나 keep alive packet을 보내서 연결상태를 보고 close 하는 방식으로 하면 될것 같습니다.
그런데 2번 질문은 close 하지 않고 예외처리를 하는 방법을 물어보신건지 궁금합니다.