On mardi 4 novembre 2008, Benoit Minisini wrote:
> On mardi 4 novembre 2008, Gareth Bult wrote:
> > Hi,
> >
> > I think I reported this quite a while ago but it still seems to be a
> > problem ... using READ to try to acquire less than the entire available
> > buffer doesn't seem to work .. and if I read the entire buffer, there's
> > no obvious way to break the packet down into it's constituent parts ...
> >
> > Anyone any ideas?
> > (and anyone any idea where the other 24 bytes are going ??)
> >
> > PRIVATE $udp AS UdpSocket
> >
> > PUBLIC SUB _new()
> >
> > $udp = NEW UdpSocket AS "Socket"
> > $udp.Bind(2000)
> >
> > END
> >
> > PUBLIC SUB Socket_Read()
> >
> > DIM cmd AS Byte
> > DIM siz AS Long
> >
> > PRINT Lof($udp)
> > READ #$udp, cmd, 1
> > PRINT Lof($udp)
> > 'READ #$udp, siz, 8 <= generates error if uncommented
> >
> > END
> >
> > $shell> echo "R00000011Hello World 123" |nc -u localhost 2000
> >
> > 25
> > 0 <=== "should be 24!"
>
> Can you try your code with Gambas 3?
>
> I have changed many things in the gb.net component there, but I didn't
> backported them to Gambas 2. If it fixes your problem, I will do!
>
> Regards,

I tested your little code, and I confirm that any read entirely voids the 
internal socket buffer. I will investigate...

-- 
Benoit Minisini

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to