| 1007 | } |
| 1008 | |
| 1009 | void SIPpSocket::abort() { |
| 1010 | /* Disable linger - we'll send a RST when we close. */ |
| 1011 | struct linger flush; |
| 1012 | flush.l_onoff = 1; |
| 1013 | flush.l_linger = 0; |
| 1014 | setsockopt(ss_fd, SOL_SOCKET, SO_LINGER, &flush, sizeof(flush)); |
| 1015 | |
| 1016 | /* Mark the socket as non-blocking. It's not clear whether this is required but can't hurt. */ |
| 1017 | int flags = fcntl(ss_fd, F_GETFL, 0); |
| 1018 | fcntl(ss_fd, F_SETFL, flags | O_NONBLOCK); |
| 1019 | |
| 1020 | int count = --ss_count; |
| 1021 | if (count == 0) { |
| 1022 | invalidate(); |
| 1023 | sockets_pending_reset.erase(this); |
| 1024 | delete this; |
| 1025 | } else { |
| 1026 | ss_fd = -1; |
| 1027 | } |
| 1028 | } |
| 1029 | |
| 1030 | void SIPpSocket::close() |
| 1031 | { |
nothing calls this directly
no outgoing calls
no test coverage detected