> I need to send commands to microcontroller using udp protocol.
> I try Sock.SendBuffer(@Buff, Len); to transmit command and
> Len := Sock.RecvBuffer(@Buff, 256); to receive a reply/acknowledge. It
> works if command is correct. If not, controller do not reply and
> RecvBuffer waits forever(or unacceptably long time). Problem is i do
> not know how to specify a timeout for RecvBuffer function. There are
> timeout parameter in similar function RecvPacket, but RecvBuffer looks
> more suitable for binary data.

Do not use RecvBuffer, until you have very special reason for that!

RecvPacket is function designed for reading binary UDP datagrams. It 
is used in all my UDP protocol implementations too. (SNMP, DNS,...)


-- 
Lukas Gebauer.

http://synapse.ararat.cz/ - Ararat Synapse - TCP/IP Lib.
http://geoget.ararat.cz/ - Geocaching solution


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to