LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I turn off the Nagel algorithm in LabWindows?

Thanks for your response OVR_CZ

 

I tried including winsock.h. I didn't have a wsock32.lib in my SDK directory but I had winmm.lib so I added that to my project.

 

Should that work?

 

I added the include for winsock.h at the top of my includes as I heard that this will prevent conflicts with LabWindows include files that will cause compiler errors however I still got compiler errors:

 

 "winbase.h" redeclaration of 'CVI_WriteFile' previously declared at formatio.h: 58

 "winbase.h" redeclaration of 'CVI_ReadFile' previously declared at formatio.h: 57

 "winbase.h" redeclaration of 'CVI_OpenFile' previously declared at formatio.h: 56

 

What's up with that?

 

I see that in your attached example you just cut and pasted things out of the include and the library. Should I just do it that way as well?

 

Thanks, Gwen

0 Kudos
Message 11 of 13
(1,485 Views)

OVR_CZ,

 

I implemented it just like you did in your example (using your WSOCK32.h and WSOCK32.c) and it compiled just fine.

 

I haven't tested it to see if it has any impact on my system.

 

The engineer on the server side has been playing with his Nagle/TCP settings and I don't want to start messing with mine at the same time.

 

Thanks for your help and I'll repost when I see how it works.

 

Gwen

0 Kudos
Message 12 of 13
(1,474 Views)

i am hapy that example work for you 🙂

 

just for complet info:

1)

if you need others function from winsock.h you can create your own import lib or import source code

as i write before, just open the header file "winsock.h" in editor and  in menu select "Options/GenerateDLL import library" or "Options/Generate dll import source", then in dialog select file "wsock32.dll" in c:\windows\system32\

after that, lot of warnings appear about missing functions because winsock.h include other headers with functions that are not defined in this DLL, regardless this is ok, just click OK and your import library/import source is created susceffuly.

 

my example file wsock32.c is created in this way(DLL import source) from wsock32.h and wsock32.dll

 

 

2)warnnigs with conflict with formatio.h

it seems to my that you don not have #include <winsock.h> first inculde in c file

just add it before all others include in your source code in this way

#include <winsock.h>
#include <cvirte.h>

#include <formatio.h>

 

P.S. my results about disble nagle algorithm tests:

when you disable  nagle algorthm, every ClientTCPWrite try to sends data imediately{do not wait some time to next writed data to join in in one packet}.

but this not meaning that one Ip packet is sending for every ClientTCPWrite

with some router in communication way , maximum packet size may be limited to smaller value(for example 1660byte or less for GPRS)

and this can cause some fragmentation IP packets to more small packets

 

horewer still when data is send in one packet, amount of data receved by server depend on how this is wite

when server use traditional tcp socket, it is posible that packet is joined in driver

,on windows (taht is not realtime OS),  it is not guaranted that server can get each individual packet , nor yet on also applies to modern hig speed CPU, you write that server run on RTOS so this is depend on implementation of socket on this RTOS, still i suppose that depend on packets fragmentation is not good way.

 

Disable nagle algorithm is good for some small optimization (in one query/response communciation)

so i do not use it normaly, one exception is comunication with special server system with combined(and dirty) TCP/IEC  layer implementation long time ago. In all other way (for my) it is beter keep this options enabled.

if you like experimets with this i recommend use some sniff tools like ethereal,with study some scripts/web/book how IP and TCP works

 

i hope this help 🙂

Message Edited by OVR_CZ on 02-22-2010 10:34 AM
0 Kudos
Message 13 of 13
(1,454 Views)