"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dataio/TCPSocketDataIO.cpp" between
muscle8.20.zip and muscle8.30.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

TCPSocketDataIO.cpp  (muscle8.20):TCPSocketDataIO.cpp  (muscle8.30)
skipping to change at line 21 skipping to change at line 21
TCPSocketDataIO :: ~TCPSocketDataIO() TCPSocketDataIO :: ~TCPSocketDataIO()
{ {
Shutdown(); Shutdown();
} }
void TCPSocketDataIO :: FlushOutput() void TCPSocketDataIO :: FlushOutput()
{ {
if (_sock()) if (_sock())
{ {
// Note: I use both cork AND Nagle because cork is a no-op outside of Lin // cork doesn't always transmit the data right away if I don't also toggle
ux, Nagle. --jaf
// and inside of Linux cork doesn't always transmit the data right away if #if !defined(__APPLE__) // Apple's implementation of TCP_NOPUSH doesn't flush p
I don't also toggle Nagle. --jaf ending data, and it occasionally causes 5-second delays :(
(void) SetSocketCorkAlgorithmEnabled(_sock, false); (void) SetSocketCorkAlgorithmEnabled(_sock, false);
#endif
if (_naglesEnabled) if (_naglesEnabled)
{ {
SetSocketNaglesAlgorithmEnabled(_sock, false); (void) SetSocketNaglesAlgorithmEnabled(_sock, false);
# if !defined(__linux__) #if !defined(__linux__)
(void) SendData(_sock, NULL, 0, _blocking); // Force immediate buffer flush (not necessary under Linux) (void) SendData(_sock, NULL, 0, _blocking); // Force immediate buffer flush (not necessary under Linux)
# endif #endif
SetSocketNaglesAlgorithmEnabled(_sock, true); (void) SetSocketNaglesAlgorithmEnabled(_sock, true);
} }
#if !defined(__APPLE__) // Apple's implementation of TCP_NOPUSH doesn't flush p
ending data, and it occasionally causes 5-second delays :(
(void) SetSocketCorkAlgorithmEnabled(_sock, true); (void) SetSocketCorkAlgorithmEnabled(_sock, true);
#endif
} }
} }
status_t TCPSocketDataIO :: SetBlockingIOEnabled(bool blocking) status_t TCPSocketDataIO :: SetBlockingIOEnabled(bool blocking)
{ {
const status_t ret = SetSocketBlockingEnabled(_sock, blocking); const status_t ret = SetSocketBlockingEnabled(_sock, blocking);
if (ret.IsOK()) _blocking = blocking; if (ret.IsOK()) _blocking = blocking;
return ret; return ret;
} }
 End of changes. 6 change blocks. 
8 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)