X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fsocket.h;h=a2cbae1a285ded03a645b377b3e2a85188213664;hp=d48f3503bac63c7463c41bed46e5e93665f678f2;hb=4feef9d7a2d96668660686d3812973e6f788359a;hpb=28e7bf7a13656620452e19d017ea5eedf14a8bc5 diff --git a/source/socket.h b/source/socket.h index d48f350..a2cbae1 100644 --- a/source/socket.h +++ b/source/socket.h @@ -29,9 +29,18 @@ public: IO::Handle get_event_handle(); bool is_connected() const { return connected; } + + /** Associates the socket with a local address. There must be no existing + users of the address. */ void bind(const SockAddr &); + + /** Connects to a remote address. Exact semantics depend on the socket + type. */ virtual int connect(const SockAddr &) = 0; + + /// Closes the socket. Most operations will throw an exception after this. void close(); + void set_timeout(const Time::TimeDelta &); const SockAddr &get_local_address() const; const SockAddr &get_peer_address() const;