I am building a server client application using netty and ios, I am facing a problem when the user just turns off WiFi on his/her ios device, the netty server does not know about it. The server needs to know to do cleanup for that user and set him/her offline, but now when the user tries to connect again, the server just tells him that he/she is already online.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Netty websocket client does not read new frames fr
相关文章
- Spring WebFlux+Netty 中怎么配置 HTTP/2?
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
Check session id and allow renegotiation. Or you may use something like cookie controller. May I ask off topic question: How does your client on ios interact with netty server? (what framework you use on client side, and what decoder/encoder use? )
If I understood your problem correctly: You want to listen for client channel closed events in server side and do some session cleanup,
There are two ways to listen for channel closed events in Netty :
1) If your server handler extends
SimpleChannelHandler/SimpleChannelHandler
, then you can override following method and write your session cleanup logic there2) If you have only access to the channel reference, then you can get the channel close future and register your implementation of
ChannelFutureListener
with your session cleanup logic,Use IdleStateHandler
You can detect when there is no request/responses in given time intervals.