win32 (net-receive-udp)

Started by newdep, July 26, 2004, 02:25:10 AM

Previous topic - Next topic

newdep

Hello Lutz,



Im wondering how (net-receive-udp) is used under windows.



As it states in the manual and works pratical that (net-receive-udp) under

windows must have the EXACT amount of bytes it should receive or otherwise it returns "nil".



Actualy that is true on protocol base like Tftp. But plain udp

you never know how big the packets size will be.





So how can the net-receive-udp know how big the size of the packet is

that is coming in?



If  i create a simple UDP server under windows in C then i can receive

all kinds of  data packages. So my question, is this packetsize receive on Windows a windows or a newlisp behaviour?



Regards, Norman
-- (define? (Cornflakes))

HPW

#1
I am also wondering, since I used it as the max-parameter, and it worked for me in that way.



Is it only a wrong doc?
Hans-Peter

newdep

#2
well the newlisp doc says it and the test with (net-receive-udp) and (net-send-udp) states it..so under newlisp there is this behaviour for sure..



When I connect with a (net-send-udp) towards my Socket program in C

I simple can receive any length..Also other langugages dont have this limitation..(udp broadcast or not both work)



I can emagine its a precausion from lutz to protect udp packets under windows

but then again? what can wrong? length is length?



Norman...
-- (define? (Cornflakes))

Lutz

#3
The manual does not describe it correctly, this is what is correct:



Both Linux and Windows will receive less or equal than the amount specified. Linux will simply cut of bytes over the maximum but Windows will fail with nil and net-error is set to "8 Socket recv failed" if receiveing over the maximum.



So on both OS simply specify the maxbytes big enough and you will receive everything.



The difference is due to the implementation of the socket call recvfrom(). On Linux it will cut off bytes on Windows it will return an error.



Lutz



ps: Manual will be corrected for the next version.