Changeset 217:48dcd8412a44 in roaraudio


Ignore:
Timestamp:
07/21/08 20:09:24 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

set TCP_CORK while sending large blocks of data via TCP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/file.c

    r215 r217  
    2727 int len; 
    2828 char buf[BUFSIZE]; 
     29#ifdef __linux__ 
     30 int cork_new = 1, cork_old; 
     31 socklen_t cork_len = sizeof(int); 
     32 
     33 getsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_old, &cork_len); 
     34 setsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_new, sizeof(int)); 
     35#endif 
    2936 
    3037#ifdef ROAR_HAVE_LINUX_SENDFILE 
     
    3845  r += write(out, buf, len); 
    3946 
     47#ifdef __linux__ 
     48 setsockopt(out, IPPROTO_TCP, TCP_CORK, &cork_old, cork_len); 
     49#endif 
    4050 return r; 
    4151} 
Note: See TracChangeset for help on using the changeset viewer.