TCP Buffer Size

BlitzMax Forums/BlitzMax Programming/TCP Buffer Size

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Local Size:Int

Size = 1% Shl 16 - 1 ' Maximum payload in TCP
If setsockopt_(Socket, SOL_SOCKET_, SO_RCVBUF_, Varptr(Size), 4) = SOCKET_ERROR_ Or ..
   setsockopt_(Self.Socket, SOL_SOCKET_, SO_SNDBUF_, Varptr(Size), 4) = SOCKET_ERROR_ Then Failed


But please make sure, you don't use original constants in Pub.StdC. These values are wrong for Linux and SOL_SOCKET is not even declared. So use this:
?Win32
	Const SOL_SOCKET_   : Int   = $FFFF
	Const SO_SNDBUF_    : Short = $1001
	Const SO_RCVBUF_    : Short = $1002

?MacOS
	Const SOL_SOCKET_   : Int   = $FFFF
	Const SO_SNDBUF_    : Short = $1001
	Const SO_RCVBUF_    : Short = $1002

?Linux
	Const SOL_SOCKET_   : Int   = 1
	Const SO_SNDBUF_    : Short = 7
	Const SO_RCVBUF_    : Short = 8
?


cu olli