diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2023-08-01 11:38:26 -0700 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2023-08-01 11:38:26 -0700 |
| commit | 87d76df1720e29e4195cf4a8845c07450fb3b2f2 (patch) | |
| tree | 6a62b8e4326570ccdbe01bfb8c71f408f6c01e2d /src/stable/sockettcp.h | |
| parent | dcf2e2182934291e7312993c78d3d3c5f72597d5 (diff) | |
| download | libbu++-87d76df1720e29e4195cf4a8845c07450fb3b2f2.tar.gz libbu++-87d76df1720e29e4195cf4a8845c07450fb3b2f2.tar.bz2 libbu++-87d76df1720e29e4195cf4a8845c07450fb3b2f2.tar.xz libbu++-87d76df1720e29e4195cf4a8845c07450fb3b2f2.zip | |
Fixed issues around disconnected sockets.
We were bailing out when sockets closed, that was silly.
Diffstat (limited to '')
| -rw-r--r-- | src/stable/sockettcp.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stable/sockettcp.h b/src/stable/sockettcp.h index 3fc14ef..8539b52 100644 --- a/src/stable/sockettcp.h +++ b/src/stable/sockettcp.h | |||
| @@ -48,7 +48,14 @@ namespace Bu | |||
| 48 | ... | 48 | ... |
| 49 | ... | 49 | ... |
| 50 | ... | 50 | ... |
| 51 | // sigset is deprecated | ||
| 51 | sigset( SIGPIPE, SIG_IGN ); // do this before you use a Bu::SocketTcp | 52 | sigset( SIGPIPE, SIG_IGN ); // do this before you use a Bu::SocketTcp |
| 53 | |||
| 54 | // this is the modern Linux alternative | ||
| 55 | struct sigaction saIgnore; | ||
| 56 | memset( &saIgnore, 0, sizeof(struct sigaction) ); | ||
| 57 | saIgnore.sa_handler = SIG_IGN; | ||
| 58 | sigaction( SIGPIPE, &saIgnore, NULL ); | ||
| 52 | @endcode | 59 | @endcode |
| 53 | * When this is done, Bu::SocketTcp will simply throw a broken pipe | 60 | * When this is done, Bu::SocketTcp will simply throw a broken pipe |
| 54 | * exception just like every other error condition, allowing your program | 61 | * exception just like every other error condition, allowing your program |
