Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » SIGPIPE problem
Re: SIGPIPE problem [message #57144 is a reply to message #57143] Mon, 31 May 2021 17:05 Go to previous messageGo to previous message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
Is this OK?
@@ -557,16 +557,22 @@ bool TcpSocket::WouldBlock()
 	}
 	return c == SOCKERR(EWOULDBLOCK);	       
 #endif
 }
 
 int TcpSocket::RawSend(const void *buf, int amount)
 {
-#ifdef PLATFORM_POSIX
-	int res = send(socket, (const char *)buf, amount, MSG_NOSIGNAL);
+#ifdef MSG_NOSIGNAL
+#define UPP_NOSIGPIPE_OPTION MSG_NOSIGNAL
+#endif
+#ifdef SO_NOSIGPIPE
+#define UPP_NOSIGPIPE_OPTION SO_NOSIGPIPE
+# endif
+#ifdef UPP_NOSIGPIPE_OPTION
+	int res = send(socket, (const char *)buf, amount, UPP_NOSIGPIPE_OPTION);
 #else
 	int res = send(socket, (const char *)buf, amount, 0);
 #endif
 	if(res < 0 && WouldBlock())
 		res = 0;
 	else
 	if(res == 0 || res < 0)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Small optimization
Next Topic: MSVS15x64: Compile Error C3256 C3259 C3250 in Fn.h findarg
Goto Forum:
  


Current Time: Thu May 09 12:22:16 CEST 2024

Total time taken to generate the page: 0.01963 seconds