Blocking sockets on Windows
Hello all,
I try to implement a simple http server with blocking sockets on Windows.
Basically, I have a simple server that just write data to a socket when a
network connection occurs before exit. The problem is that the last
"socket.send" as no effect if I don't delay the process exit. Writing to
this socket is supposed to block until all the data as been written.
I have tried to use the completion condition of write, to use the
non_blocking method of the socket. I still get the same problem.
Note that the problem doesn't occur on Linux.
Here is the code:
```
#include
You probably need to shutdown the socket nicely.
See bottom of http://www.boost.org/doc/libs/1_61_0/doc/html/boost_asio/reference/basic_str...
BR,
Martin
From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of William Riancho
Sent: Wednesday, May 18, 2016 05:25
To: boost-users@lists.boost.org
Subject: [Boost-users] Blocking sockets on Windows
Hello all,
I try to implement a simple http server with blocking sockets on Windows. Basically, I have a simple server that just write data to a socket when a network connection occurs before exit. The problem is that the last "socket.send" as no effect if I don't delay the process exit. Writing to this socket is supposed to block until all the data as been written.
I have tried to use the completion condition of write, to use the non_blocking method of the socket. I still get the same problem.
Note that the problem doesn't occur on Linux.
Here is the code:
```
#include
participants (2)
-
Martin Dyring-Andersen
-
William Riancho