LUMIX GX80 UDP Streaming

Find quick help here to get you started with Hollywood
sinisrus
Posts: 301
Joined: Tue Apr 21, 2015 5:43 pm

Re: LUMIX GX80 UDP Streaming

Post by sinisrus »

ReceiveUDPData() Max size is 8192 I can't get more :-((

User avatar
lazi
Posts: 561
Joined: Thu Feb 24, 2011 11:08 pm

Re: LUMIX GX80 UDP Streaming

Post by lazi »

No, it is a default value which is valid if you not set the 'size' parameter.
If you want other maximum number of bytes to receive then set it at the second value of the function.

sinisrus
Posts: 301
Joined: Tue Apr 21, 2015 5:43 pm

Re: LUMIX GX80 UDP Streaming

Post by sinisrus »

I know but no matter what value I put 65527 or 80,000 or 10,000 I always have packages of 8192

plouf
Posts: 157
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: LUMIX GX80 UDP Streaming

Post by plouf »

if you have any problem, you should create a small, smallest possible code to demostrate problem

here i have modified a bit some samples and yes i see that 8192 seems to be a hardcore limit, or we are doing something wrong
the following test files are tested in Windows and as long as i send 819_3_ bytes i get error "message too long

so either we are doing soemthing wrong, or hollywood has some hardcoded max limit to 8192

sample server demostaring our "problem"

Code: Select all

af = CreateUDPObject(Nil, 12345)
DebugPrint(GetLocalPort(af, #NETWORKUDP))

InstallEventHandler({onreceiveudpdata = Function(msg)

	DebugPrint("received")
	data$,ip$,port = ReceiveUDPData(af,10000)
	OpenFile(1,"c:\\receiveudpdata.raw",#MODE_WRITE)
	WriteString(1,data$)
	CloseFile(1)
	DebugPrint("ok")
	EndFunction})

Repeat
	WaitEvent
Forever
sample client

Code: Select all

CreateUDPObject(1)
For i=1 To 1
	For y=1 To 8192
		data$ = data$.. ToString(i)
	Next 
Next 

InstallEventHandler({onkeyup = Function(msg)
	SendUDPData(1,data$, "127.0.0.1", 12345)
EndFunction})

Repeat
	WaitEvent
Forever
Christos

sinisrus
Posts: 301
Joined: Tue Apr 21, 2015 5:43 pm

Re: LUMIX GX80 UDP Streaming

Post by sinisrus »

Yes i have error ! :-/

User avatar
airsoftsoftwair
Posts: 4441
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: LUMIX GX80 UDP Streaming

Post by airsoftsoftwair »

Yes, you're right. ReceiveUDPData() is limited to 8192 bytes per call. Actually we've had this before, see here: viewtopic.php?f=4&t=2237

plouf
Posts: 157
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: LUMIX GX80 UDP Streaming

Post by plouf »

no its not mentiom
manual clearly states

Code: Select all

size
    optional: maximum number of bytes to receive (defaults to 8192 bytes)
which means that it set to 8192 but if you CHANGE size with size attribute you can have a differenct size
either 1024 or 65535 , which is ,in my knowledge, true udp limit
Christos

User avatar
airsoftsoftwair
Posts: 4441
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: LUMIX GX80 UDP Streaming

Post by airsoftsoftwair »

I've edited my reply. It is mentioned in the latest Hollywood master because of this report: viewtopic.php?f=4&t=2237 But it's not in the 8.0 docs.

plouf
Posts: 157
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: LUMIX GX80 UDP Streaming

Post by plouf »

ok, so this is a hollywood limitaion but how to workaround if a server sends bigger files ?

i have try the following

Code: Select all

data$,ip$,port = ReceiveUDPData(af,4096)
data2$,ip$,port = ReceiveUDPData(af,4096)
yet again hollywood fails in FIRST line because data to be received are larger that its "size" so is there a workaround for this ?

fails message in debug
Error in line 7 (UDP-test_Server_bigfile.hws): The following network error occurred:
Message too long
Christos

User avatar
airsoftsoftwair
Posts: 4441
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: LUMIX GX80 UDP Streaming

Post by airsoftsoftwair »

What is the test code and test system? The code you posted here works for me on Windows.

Post Reply