Lines Matching defs:wsi
94 * So when we take down a route, we take care to look for any wsi that was
95 * estimated to be using that route, eg, for gateway, and close those wsi.
298 _lws_route_check_wsi(struct lws *wsi)
300 struct lws_context_per_thread *pt = &wsi->a.context->pt[(int)wsi->tsi];
303 if (!wsi->sa46_peer.sa4.sin_family ||
305 wsi->unix_skt ||
306 wsi->sa46_peer.sa4.sin_family == AF_UNIX ||
308 wsi->desc.sockfd == LWS_SOCK_INVALID)
315 if (!_lws_route_est_outgoing(pt, &wsi->sa46_peer)) {
317 lwsl_wsi_notice(wsi, "dest route gone");
323 lws_sa46_write_numeric_address(&wsi->sa46_local,
325 //lwsl_notice("%s: %s sa46_local %s fam %d\n", __func__, wsi->lc.gutag,
326 // buf, wsi->sa46_local.sa4.sin_family);
328 if (wsi->sa46_local.sa4.sin_family &&
329 !_lws_route_find_source(pt, &wsi->sa46_local)) {
331 lws_sa46_write_numeric_address(&wsi->sa46_local,
333 lwsl_wsi_notice(wsi, "source %s gone", buf);
338 lwsl_wsi_debug(wsi, "source + dest OK");
346 struct lws *wsi;
363 wsi = wsi_from_fd(pt->context, pt->fds[n].fd);
364 if (!wsi)
367 if (_lws_route_check_wsi(wsi)) {
368 lwsl_wsi_info(wsi, "culling wsi");
369 lws_wsi_close(wsi, LWS_TO_KILL_ASYNC);
380 struct lws *wsi;
389 wsi = wsi_from_fd(pt->context, pt->fds[n].fd);
390 if (!wsi)
393 if (wsi->desc.sockfd != LWS_SOCK_INVALID &&
395 !wsi->unix_skt &&
396 wsi->sa46_peer.sa4.sin_family != AF_UNIX &&
398 wsi->sa46_peer.sa4.sin_family &&
399 wsi->peer_route_uidx == uidx) {
400 lwsl_wsi_notice(wsi, "culling wsi");
401 lws_wsi_close(wsi, LWS_TO_KILL_ASYNC);