bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UDP client programming


From: Mike Frysinger
Subject: Re: UDP client programming
Date: Fri, 10 Apr 2009 15:51:54 -0400
User-agent: KMail/1.11.1 (Linux/2.6.28; KDE/4.2.1; x86_64; ; )

On Friday 10 April 2009 08:06:17 Henri Moreau wrote:
> My script sends a UDP query to a server and gets a response datagram.  All
> packets are character strings and I have had trouble reading the response.
> A method that I have found to work is to arrange for the response packet to
> have a unique terminating character ('\0') and to pipe the response into a
> trivial gawk script with RS="\0".  Simpler methods such as using read or
> cat fail.  For read, "read -n1" will read one character but "read -nx",
> x!=1 just hangs.  Piping the response into cat reads the response but the
> pipeline does not terminate so my script cannot continue.  I would like to
> know if there are tricks and tips for using sockets more effectively in
> bash.  My search on the topic often simply advises users to keep away from
> bash networking.

showing example code people can run goes a loooong way ...
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]