For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > December 2005 > Obtaining data from a UDP Port









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Obtaining data from a UDP Port
Mark Hobley

2005-12-17, 7:01 pm

I wish to use a script to obtain some data, which I hope to send via a port.

I have created an entry in /etc/inetd.conf as follows:

4001 dgram udp wait webcount /scripts/system/websys/countupd.sh countupd

My script countupd.sh is as follows:

#!/bin/sh
read MSG # presumably input from the inetd invocation is on standard input
eval "`./zapcrap.exe`" # remove bad characters from MSG
echo "$MSG" > /tmp/test.fil

Is this all that I need to do to get the data ?

I will be sending a text message to the port via netcat, when I find out how
to do this.

Mark.

--
Mark Hobley
393 Quinton Road West
QUINTON
Birmingham
B32 1QE

Telephone: (0121) 247 1596
International: 0044 121 247 1596

Email: markhobley at hotpop dot donottypethisbit com

http://markhobley.yi.org/

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com