Help - Disable Nagle Algorithm in VB6-VBForums
Results 1 to 2 of 2

Thread: Help - Disable Nagle Algorithm in VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2018
    Posts
    1

    Help - Disable Nagle Algorithm in VB6

    I've read tons about whether or not to do it, but I can't find any documentation for VB6 or example code of someone who has actually done it. I've spent hours searching for the code. Now I'm convinced it can't be done in VB6, or at least I haven't found the right code. Here's what I've tried and the result.

    sockMain.NoDelay = True
    *Error: Throws an error that method or data member is not found and it highlights NoDelay.

    setsockopt sockMain.SocketHandle, SOL_SOCKET, TCP_NODELAY, OptVal, Len(OptVal)
    *OptVal is set to 1
    **Error: Variable not defined and highlights SOL_SOCKET

    Any help is appreciated.

  2. #2
    Frenzied Member
    Join Date
    Jun 2015
    Posts
    1,731

    Re: Help - Disable Nagle Algorithm in VB6

    Code:
    Private Const SOL_SOCKET As Long = &HFFFF&
    Private Const TCP_NODELAY As Long = &H1
    Private Declare Function getsockopt Lib "ws2_32" ( _
        ByVal s As Long, _
        ByVal level As Long, _
        ByVal optname As Long, _
        ByRef optval As Any, _
        ByRef optlen As Long _
        ) As Long
    Code:
        Dim TcpNoDelay As Long 'WIN32 BOOL
        getsockopt sockMain.SocketHandle, SOL_SOCKET, TCP_NODELAY, TcpNoDelay, LenB(TcpNoDelay)
    Imagine what it would be like to set breakpoints in, or step through subclassing code;
    and then being able to hit stop/end/debug or continue, without crashing the IDE.

    VB6.tlb | Bulletproof Subclassing in the IDE (no thunks/assembly/DEP issues)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width