.TH "shevek::socket" 3 "Wed Jul 9 2014" "libshevek" \" -*- nroff -*- .ad l .nh .SH NAME shevek::socket \- .PP Use a unix-domain, tcp or avahi network connection with \fBshevek::fd\fP\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBshevek::fd\fP\&. .PP Inherited by \fBshevek::telnet\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "typedef sigc::signal0< void > \fBdisconnect_t\fP" .br .RI "\fIDisconnect signal type\&. \fP" .ti -1c .RI "typedef sigc::slot0< void > \fBlisten_t\fP" .br .RI "\fINew connection callback type\&. \fP" .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "void \fBlisten_unix\fP (std::string const &\fBfile\fP, \fBlisten_t\fP cb, unsigned queue=10)" .br .RI "\fIListen for new connections on a UNIX socket\&. Use listen instead\&. \fP" .ti -1c .RI "void \fBlisten_tcp\fP (std::string const &service, \fBlisten_t\fP cb, unsigned queue=10)" .br .RI "\fIListen for new connections on a TCP socket\&. Use listen instead\&. \fP" .ti -1c .RI "void \fBlisten_avahi\fP (std::string const &service, Glib::ustring const &protocol, Glib::ustring const &name, \fBlisten_t\fP cb, unsigned queue=10)" .br .RI "\fIListen for new connections on a TCP socket, and register it with avahi\&. Use listen instead\&. \fP" .ti -1c .RI "void \fBlisten\fP (std::string const &port, \fBlisten_t\fP cb, unsigned queue=10)" .br .RI "\fIListen for new connections\&. \fP" .ti -1c .RI "void \fBconnect_unix\fP (std::string const &unix_name)" .br .RI "\fIConnect to a UNIX socket\&. Use connect instead\&. \fP" .ti -1c .RI "void \fBconnect_tcp\fP (std::string const &host, std::string const &service)" .br .RI "\fIConnect to a TCP socket\&. Use connect instead\&. \fP" .ti -1c .RI "void \fBconnect_avahi\fP (\fBavahi::browser::owner\fP const &target, \fBavahi::browser::details\fP const &details=\fBavahi::browser::details\fP())" .br .RI "\fIConnect to an avahi TCP socket\&. Use connect instead\&. \fP" .ti -1c .RI "void \fBconnect\fP (std::string const &port)" .br .RI "\fIConnect to a socket\&. \fP" .ti -1c .RI "void \fBaccept\fP (Glib::RefPtr< \fBsocket\fP > sock)" .br .RI "\fIAccept a connection (only allowed on a listening socket)\&. \fP" .ti -1c .RI "std::string \fBget_peer_info\fP (bool numeric=false) const " .br .RI "\fIGet information about the other side of a connection\&. \fP" .ti -1c .RI "std::string \fBget_own_info\fP (bool numeric=false) const " .br .RI "\fIGet info about our side of the connection\&. \fP" .ti -1c .RI "\fBdisconnect_t\fP \fBsignal_disconnect\fP ()" .br .RI "\fISchedule a function to be called when the socket is disconnected\&. \fP" .ti -1c .RI "void \fBdisconnect\fP ()" .br .RI "\fIDisconnect the socket without reconnecting\&. \fP" .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static Glib::RefPtr< \fBsocket\fP > \fBcreate\fP (Glib::RefPtr< Glib::MainContext > main=Glib::MainContext::get_default())" .br .RI "\fICreate a new socket\&. \fP" .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "\fBsocket\fP (Glib::RefPtr< Glib::MainContext > main)" .br .RI "\fIConstructor\&. \fP" .ti -1c .RI "virtual \fB~socket\fP ()" .br .RI "\fIDestructor\&. \fP" .in -1c .SH "Detailed Description" .PP Use a unix-domain, tcp or avahi network connection with \fBshevek::fd\fP\&. .SH "Member Function Documentation" .PP .SS "void shevek::socket::connect (std::string const &port)" .PP Connect to a socket\&. This is the preferred function to use\&. Format: UNIX domain sockets: anything with at least one / in it\&. TCP: hostname:port, where the hostname and colon may be omitted, and the port may be a service or number\&. Avahi: name|protocol, where name is the application name, and protocol the connection type\&. .SS "void shevek::socket::listen (std::string const &port, \fBlisten_t\fPcb, unsignedqueue = \fC10\fP)" .PP Listen for new connections\&. This is the preferred function to use\&. Format: UNIX domain sockets: anything with at least one / in it\&. TCP services: the name\&. TCP port numbers: the number\&. For TCP, appending |name|protocol, where name is the application name and protocol the connection type\&. .SH "Author" .PP Generated automatically by Doxygen for libshevek from the source code\&.