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 #57146 is a reply to message #57145] Mon, 31 May 2021 17:10 Go to previous messageGo to previous message
zsolt is currently offline  zsolt
Messages: 702
Registered: December 2005
Location: Budapest, Hungary
Contributor
Or this one is better:
int TcpSocket::RawSend(const void *buf, int amount)
{
#ifdef MSG_NOSIGNAL
#define UPP_NOSIGPIPE_OPTION MSG_NOSIGNAL
#endif
#ifdef SO_NOSIGPIPE
#define UPP_NOSIGPIPE_OPTION SO_NOSIGPIPE
#endif
#ifndef UPP_NOSIGPIPE_OPTION
#define UPP_NOSIGPIPE_OPTION 0
#endif
	int res = send(socket, (const char *)buf, amount, UPP_NOSIGPIPE_OPTION);
	if(res < 0 && WouldBlock())
		res = 0;
	else
	if(res == 0 || res < 0)
		SetSockError("send");
	return res;
}
 
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: Sat May 10 09:55:19 CEST 2025

Total time taken to generate the page: 0.02990 seconds