delete peer_addr;
}
+void ClientSocket::shutdown(IO::Mode m)
+{
+ int how;
+ m = m&IO::M_RDWR;
+#ifdef WIN32
+ if(m==IO::M_READ)
+ how = SD_RECEIVE;
+ else if(m==IO::M_WRITE)
+ how = SD_SEND;
+ else if(m==IO::M_RDWR)
+ how = SD_BOTH;
+#else
+ if(m==IO::M_READ)
+ how = SHUT_RD;
+ else if(m==IO::M_WRITE)
+ how = SHUT_WR;
+ else if(m==IO::M_RDWR)
+ how = SHUT_RDWR;
+#endif
+ else
+ return;
+
+ ::shutdown(priv->handle, how);
+ mode = mode&~m;
+}
+
const SockAddr &ClientSocket::get_peer_address() const
{
if(peer_addr==0)
unsigned ClientSocket::do_write(const char *buf, unsigned size)
{
+ check_access(IO::M_WRITE);
if(!connected)
throw bad_socket_state("not connected");
unsigned ClientSocket::do_read(char *buf, unsigned size)
{
+ check_access(IO::M_READ);
if(!connected)
throw bad_socket_state("not connected");
bool is_connecting() const { return connecting; }
bool is_connected() const { return connected; }
+ void shutdown(IO::Mode);
+
const SockAddr &get_peer_address() const;
protected:
virtual unsigned do_write(const char *, unsigned);