looking for example code for time server

Discuss any general programming issues here
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: looking for example code for time server

Post by sinisrus »

@Andreas

there seems to be a limitation 8192 max is it possible to have more?
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: looking for example code for time server

Post by airsoftsoftwair »

plouf wrote: Mon Oct 19, 2020 6:07 am receiveudp data(af)
Can't reproduce this here. What system did you test this on?
sinisrus wrote: Tue Oct 27, 2020 10:10 am there seems to be a limitation 8192 max is it possible to have more?
This is a lot of work because it would require ReceiveUDPData() to support lots of stuff like window event handling in case it blocks for a longer time or user progress callbacks. I don't really think that's worth the effort. You can just read in smaller chunks. It's very simple to do that.
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: looking for example code for time server

Post by plouf »

airsoftsoftwair wrote: Wed Oct 28, 2020 10:59 pm
plouf wrote: Mon Oct 19, 2020 6:07 am receiveudp data(af)
Can't reproduce this here. What system did you test this on?
windows 7 64 bit
Christos
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: looking for example code for time server

Post by airsoftsoftwair »

plouf wrote: Wed Oct 28, 2020 11:00 pm windows 7 64 bit
Weird. What server code did you use?
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: looking for example code for time server

Post by plouf »

server from here
viewtopic.php?p=7611#p7611

posted again

server (from andreas post)

Code: Select all

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

InstallEventHandler({onreceiveudpdata = Function(msg)

	DebugPrint(msg.action, ReceiveUDPData(af))
	
	EndFunction})

Repeat
	WaitEvent
Forever
client with problem

Code: Select all

; Client example from above test files
CreateUDPObject(1)

InstallEventHandler({onkeyup = Function(msg)
	;SendUDPData(1, ByteChr(65), "127.0.0.1", 12345)  ; <- OK
	SendUDPData(1, ByteChr(128), "127.0.0.1", 12345)  ; <-NOT  OK
EndFunction})

Repeat
	WaitEvent
Forever
Christos
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: looking for example code for time server

Post by airsoftsoftwair »

Works here on Windows 7. How do you test this? From the Hollywood IDE or a console? What is the exact error message?
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: looking for example code for time server

Post by airsoftsoftwair »

sinisrus wrote: Wed Oct 14, 2020 11:30 pmWinUAE
It's a bug in WinUAE's bsdsocket.library. It doesn't appear on real hardware or on OS4 or MorphOS. I've reported it to Toni Wilen and he has fixed it, see here for a fixed WinUAE binary: http://eab.abime.net/showthread.php?t=104569
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: looking for example code for time server

Post by plouf »

airsoftsoftwair wrote: Thu Oct 29, 2020 5:27 pm Works here on Windows 7. How do you test this? From the Hollywood IDE or a console? What is the exact error message?
yes via ide

when receiving data in debug window (bottom) says "Received ... A adasd" (when you send character A)
when receiving data with >127 as first bytw the above line DO NOT appears at all
Christos
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: looking for example code for time server

Post by airsoftsoftwair »

Code: Select all

- Fix [IDE]: Hollywood output that didn't contain valid UTF-8 wasn't shown in the debug window; the IDE
  will now assume that the text is ISO 8859-1 encoded in such cases
Post Reply