Skip to content

Commit f7566bd

Browse files
kalcutterrotty
authored andcommitted
Socket: Add binding for zmq_unbind
Fixes #271
1 parent 4846423 commit f7566bd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,13 @@ impl Socket {
614614
Ok(())
615615
}
616616

617+
/// Stop accepting connections on a socket
618+
pub fn unbind(&self, endpoint: &str) -> Result<()> {
619+
let c_str = ffi::CString::new(endpoint.as_bytes()).unwrap();
620+
zmq_try!(unsafe { zmq_sys::zmq_unbind(self.sock, c_str.as_ptr()) });
621+
Ok(())
622+
}
623+
617624
/// Connect a socket.
618625
pub fn connect(&self, endpoint: &str) -> Result<()> {
619626
let c_str = ffi::CString::new(endpoint.as_bytes()).unwrap();

0 commit comments

Comments
 (0)