Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add "connected" method to Freesum::Connection::Handle

  • Loading branch information...
commit 456dcd29d835122fad8ae6983f45836ee8ccfbc1 1 parent 6177ef0
@luben luben authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 Feersum.xs
View
18 Feersum.xs
@@ -2511,6 +2511,24 @@ seek (feer_conn_handle *hdl, ssize_t offset, ...)
RETVAL
int
+connected (feer_conn_handle *hdl)
+ PROTOTYPE: $
+ CODE:
+{
+ assert(ix);
+ socklen_t addrlen;
+ int res;
+ res = getpeername(hdl->fd, hdl->sa, &addrlen);
+ if (res == 0) {
+ RETVAL = 1;
+ } else {
+ RETVAL = 0;
+ }
+}
+ OUTPUT:
+ RETVAL
+
+int
close (feer_conn_handle *hdl)
PROTOTYPE: $
ALIAS:
Please sign in to comment.
Something went wrong with that request. Please try again.