#include "DisplaySocket.h"

void DisplaySocket::OnRead()
{
  TcpSocket::OnRead();
  size_t n = ibuf.GetLength();
  if(n > 0) {
    char tmp[TCP_BUFSIZE_READ];
    ibuf.Read(tmp, n);
    printf("Read %d bytes:\n", n);
    for(size_t i = 0; i < n; i++)
      printf("%c", isprint(tmp[i]) ? tmp[i] : '.');
    printf("\n");
  }
}

