--- a/Socket.st Mon Oct 27 21:18:46 2003 +0100
+++ b/Socket.st Mon Oct 27 21:22:36 2003 +0100
@@ -3610,6 +3610,33 @@
^ false
!
+setTCPCork:aBoolean
+ "enable/disable TCP_CORK (do-not-send-partial-frames)
+ For special applications only.
+ Not all OperatingSystems offer this functionality
+ (returns false, if unsupported)"
+
+ filePointer isNil ifTrue:[
+ ^ self errorNotOpen
+ ].
+%{
+#if defined(IPPROTO_TCP) && defined(TCP_CORK)
+ int onOff = (aBoolean == true);
+
+ if ((aBoolean == true) || (aBoolean == false)) {
+ OBJ fp = __INST(filePointer);
+ int sock;
+ int onOff = (aBoolean == true);
+
+ sock = fileno(__FILEVal(fp));
+ setsockopt(sock, IPPROTO_TCP, TCP_CORK, (char *)&onOff, sizeof(int));
+ RETURN(true);
+ }
+#endif
+%}.
+ ^ false
+!
+
setTCPNoDelay:aBoolean
"enable/disable TCP_NODELAY (i.e. disable/enable the Nagle algorithm)
For special applications only.
@@ -3620,7 +3647,7 @@
^ self errorNotOpen
].
%{
-#if defined(TCP_NODELAY) && defined(IPPROTO_TCP)
+#if defined(IPPROTO_TCP) && defined(TCP_NODELAY)
int onOff = (aBoolean == true);
if ((aBoolean == true) || (aBoolean == false)) {
@@ -3629,7 +3656,7 @@
int onOff = (aBoolean == true);
sock = fileno(__FILEVal(fp));
- setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (char *)&onOff, sizeof(int));
+ setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (char *)&onOff, sizeof(int));
RETURN(true);
}
#endif
@@ -3640,5 +3667,5 @@
!Socket class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.194 2003-10-27 20:18:46 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/Socket.st,v 1.195 2003-10-27 20:22:36 cg Exp $'
! !