[Top][All Lists]

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

[PATCH] bash: add socket server support

From: Joel Martin
Subject: [PATCH] bash: add socket server support
Date: Tue, 12 Nov 2013 16:02:53 -0500

Currently, an outbound socket connection (client) can be created using the

exec 5<> /dev/tcp/HOST/PORT

This patch implements support for accepting incoming connections (server)
using a slightly different syntax:

exec 6<> /dev/tcp/HOST/:PORT   # note the colon

The listen/accept call will block until a connection is received and it
will be bound to the redirection.

Included in the patch is a small test that has an example of usage. I've
also attach a minimal web server that leverages this functionality (pure
bash except for a call to wc and cat).

Please include me in Cc since I am not on the list.


Joel Martin (kanaka)

Attachment: 0001-Listening-socket-support-via-dev-tcp-HOST-PORT.patch
Description: Text Data

Attachment: www.sh
Description: Bourne shell script

reply via email to

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