aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-04-15 09:54:31 +0200
committertomsmeding <tom.smeding@gmail.com>2017-04-15 09:54:31 +0200
commitffda2b39b6fe070a3f5edb229dd7806c362cc9e1 (patch)
treef9b389d4a15f32c761b8e718d2ae2853722d62db /net.c
parente11fe27b96ba5eeaae9abb04071888548e088c12 (diff)
server: Add cmd_ping
Diffstat (limited to 'net.c')
-rw-r--r--net.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net.c b/net.c
index 8e6644c..e5bdb6b 100644
--- a/net.c
+++ b/net.c
@@ -73,3 +73,11 @@ bool net_send_list(int fd,const char *tag,i64 count,const char **list){
return net_send_raw_text(fd,"\n",1);
}
+
+bool net_send_pong(int fd,const char *tag){
+ char *buf=NULL;
+ i64 len=asprintf(&buf,"%s pong\n",tag);
+ bool closed=net_send_raw_text(fd,buf,len);
+ free(buf);
+ return closed;
+}