summaryrefslogtreecommitdiff
path: root/src/tests/socketbreak.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/tests/socketbreak.cpp35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/tests/socketbreak.cpp b/src/tests/socketbreak.cpp
deleted file mode 100644
index d58ebcf..0000000
--- a/src/tests/socketbreak.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Copyright (C) 2007-2011 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
8#include "bu/tcpserversocket.h"
9#include "bu/tcpsocket.h"
10#include <unistd.h>
11
12int main()
13{
14 Bu::TcpServerSocket sSrv( 9987 );
15
16 Bu::TcpSocket sSend("localhost", 9987 );
17
18 Bu::TcpSocket sRecv( sSrv.accept() );
19
20 printf("Connected sockets.\n");
21
22 sleep( 1 );
23 printf("Closing sRecv.\n");
24 sRecv.close();
25 sleep( 1 );
26
27 char buf[3];
28 printf("About to write.\n");
29 printf("write: %lld\n", sSend.write("hi", 2 ) );
30 printf("About to read.\n");
31 printf("read: %lld\n", sSend.read( buf, 2 ) );
32
33 return 0;
34}
35