]>
Commit | Line | Data |
---|---|---|
53e6db90 DC |
1 | ;ELC\1c\0\0\0 |
2 | ;;; Compiled | |
3 | ;;; in Emacs version 28.2 | |
4 | ;;; with all optimizations. | |
5 | ||
6 | ||
7 | ||
8 | (byte-code "\300\301!\210\302\303\304\305\306\307%\210\310\311\312\313\314DD\315\316\317\306\303&\a\210\310\320\312\313\321DD\322\316\317\306\303&\a\207" [require jabber-ping custom-declare-group jabber-keepalive nil "Keepalive functions try to detect lost connection" :group jabber custom-declare-variable jabber-keepalive-interval funcall function #[0 "\300\207" [600] 1 #1=""] "Interval in seconds between connection checks." :type integer jabber-keepalive-timeout #[0 "\300\207" [20] 1 #1#] "Seconds to wait for response from server."] 8) | |
9 | #@38 Timer object for keepalive function.\1f | |
10 | (defvar jabber-keepalive-timer nil (#$ . 625)) | |
11 | #@46 Timer object for keepalive timeout function.\1f | |
12 | (defvar jabber-keepalive-timeout-timer nil (#$ . 715)) | |
13 | #@44 List of outstanding keepalive connections.\1f | |
14 | (defvar jabber-keepalive-pending nil (#$ . 821)) | |
15 | #@37 Log keepalive traffic when non-nil.\1f | |
16 | (defvar jabber-keepalive-debug nil (#$ . 919)) | |
17 | #@389 Activate keepalive. | |
18 | That is, regularly send a ping request to the server, and | |
19 | disconnect it if it doesn't answer. See variable `jabber-keepalive-interval' | |
20 | and variable `jabber-keepalive-timeout'. | |
21 | ||
22 | The JC argument makes it possible to add this function to | |
23 | `jabber-post-connect-hooks'; it is ignored. Keepalive is activated | |
24 | for all accounts regardless of the argument. | |
25 | ||
26 | (fn &optional JC)\1f | |
27 | (defalias 'jabber-keepalive-start #[256 "\b\203\a\0\302 \210\303\304 \305#\10\306\307\302\"\207" [jabber-keepalive-timer jabber-keepalive-interval jabber-keepalive-stop run-with-timer 5 jabber-keepalive-do add-hook jabber-post-disconnect-hook] 5 (#$ . 1009) nil]) | |
28 | #@23 Deactivate keepalive.\1f | |
29 | (defalias 'jabber-keepalive-stop #[0 "\b\205\v\0\301\b!\210\302\211\10\207" [jabber-keepalive-timer jabber-cancel-timer nil] 2 (#$ . 1662) nil]) | |
30 | (defalias 'jabber-keepalive-do #[0 "\b\203\n\0\305\306\307 \"\210\310 \311\301#\12\v\14\v\211\205(\0\211@\312\ 1\311\313\311\211%\210\ 1A\266\202\202\13\0\207" [jabber-keepalive-debug jabber-keepalive-timeout jabber-keepalive-timeout-timer jabber-connections jabber-keepalive-pending message "%s: sending keepalive packet(s)" current-time-string run-with-timer nil jabber-ping-send jabber-keepalive-got-response] 8]) | |
31 | #@22 | |
32 | ||
33 | (fn JC &rest ARGS)\1f | |
34 | (defalias 'jabber-keepalive-got-response #[385 "\b\203\11\0\303\304\305 \306\307\ 6\ 6!\310\"#\210\311\ 2 \"\211\11?\205(\0\312\n!\205(\0\313\n!\210\314\211\12\207" [jabber-keepalive-debug jabber-keepalive-pending jabber-keepalive-timeout-timer message "%s: got keepalive response from %s" current-time-string plist-get fsm-get-state-data :server remq timerp jabber-cancel-timer nil] 9 (#$ . 2230)]) | |
35 | (defalias 'jabber-keepalive-timeout #[0 "\302\b!\210\303\10 \211\205*\0\211@\304\305\306 \307\310\ 5!\311\"#\210\312\313\ 2\"\210\314\ 1\303\"\210\ 1A\266\202\202\a\0\207" [jabber-keepalive-timer jabber-keepalive-pending jabber-cancel-timer nil message "%s: keepalive timeout, connection to %s considered lost" current-time-string plist-get fsm-get-state-data :server run-hook-with-args jabber-lost-connection-hooks jabber-disconnect-one] 8]) | |
36 | (byte-code "\300\301\302\303\304DD\305\306\307\310\311&\a\207" [custom-declare-variable jabber-whitespace-ping-interval funcall function #[0 "\300\207" [30] 1 ""] "Send a space character to the server with this interval, in seconds.\n\nThis is a traditional remedy for a number of problems: to keep NAT\nboxes from considering the connection dead, to have the OS discover\nearlier that the connection is lost, and to placate servers which rely\non the client doing this, e.g. Openfire.\n\nIf you want to verify that the server is able to answer, see\n`jabber-keepalive-start' for another mechanism." :type (integer :tag "Interval in seconds") :group jabber-core] 8) | |
37 | #@36 Timer object for whitespace pings.\1f | |
38 | (defvar jabber-whitespace-ping-timer nil (#$ . 3736)) | |
39 | #@188 Start sending whitespace pings at regular intervals. | |
40 | See `jabber-whitespace-ping-interval'. | |
41 | ||
42 | The JC argument is ignored; whitespace pings are enabled for all | |
43 | accounts. | |
44 | ||
45 | (fn &optional JC)\1f | |
46 | (defalias 'jabber-whitespace-ping-start #[256 "\b\203\a\0\302 \210\303\304 \305#\10\306\307\302\"\207" [jabber-whitespace-ping-timer jabber-whitespace-ping-interval jabber-whitespace-ping-stop run-with-timer 5 jabber-whitespace-ping-do add-hook jabber-post-disconnect-hook] 5 (#$ . 3832) nil]) | |
47 | #@30 Deactivate whitespace pings.\1f | |
48 | (defalias 'jabber-whitespace-ping-stop #[0 "\b\205\v\0\301\b!\210\302\211\10\207" [jabber-whitespace-ping-timer jabber-cancel-timer nil] 2 (#$ . 4314) nil]) | |
49 | (defalias 'jabber-whitespace-ping-do #[0 "\b\211\205\1c\0\211@\3011\14\0\302\ 1\303\"0\210\202\15\0\210\ 1A\266\202\202\ 1\0\207" [jabber-connections (error) jabber-send-string " "] 5]) | |
50 | (provide 'jabber-keepalive) |