Re: [fpc-pascal] SOLVED fpSelect fails with UDP sockets?

2016-04-03 Thread Mark Morgan Lloyd
wkitt...@windstream.net wrote: NOTE: i've not done any research to see what dadr.sin_addr.s_bytes is but i assume that it is an array of bytes to contain each of the IP address parts... It's usually an untagged variant record so you can also do something like target.s_addr:=

Re: [fpc-pascal] SOLVED fpSelect fails with UDP sockets?

2016-04-03 Thread wkitty42
On 04/03/2016 12:32 PM, Klaus Hartnegg wrote: dadr.sin_family := AF_INET; dadr.sin_addr.s_bytes[1] := 127; dadr.sin_addr.s_bytes[2] := 0; dadr.sin_addr.s_bytes[2] := 0; dadr.sin_addr.s_bytes[2] := 1; shouldn't this be dadr.sin_addr.s_bytes[1] := 127;

Re: [fpc-pascal] SOLVED fpSelect fails with UDP sockets?

2016-04-03 Thread Klaus Hartnegg
Am 03.04.2016 um 18:32 schrieb Klaus Hartnegg: dadr.sin_addr.s_bytes[1] := 127; dadr.sin_addr.s_bytes[2] := 0; dadr.sin_addr.s_bytes[2] := 0; dadr.sin_addr.s_bytes[2] := 1; The array index numbers are of course garbage (from incomplete copy editing), but somehow it worked

Re: [fpc-pascal] SOLVED fpSelect fails with UDP sockets?

2016-04-03 Thread Klaus Hartnegg
It works with rc := fpSelect (sock+1,@FDS,nil,nil,5000); I did not understand the description of the first argument in the docs, so I used the value from the sample, this was not a good idea. For reference here is the source that works: Uses UnixType, BaseUnix, Sockets; procedure abort