#include <grp.h>
#include <sstream>
+#include <iostream>
#include "socket_handler.hxx"
#include "t2n_exception.hxx"
void socket_handler::close()
{
+ // graceful shutdown
+ shutdown(sock,SHUT_RDWR);
::close(sock);
}
+bool socket_handler::is_closed()
+{
+ int r=fcntl(sock,F_GETFL);
+
+ return !(r & O_ACCMODE);
+}
+
bool socket_handler::data_waiting(long long usec_timeout)
{
// just our socket
return false;
}
-void socket_handler::write(const std::string& data)
+void socket_handler::socket_write(const std::string& data)
{
int offset = 0;
while (offset < data.size())