[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2. Networking With gawk
The awk
programming language was originally developed as a
pattern-matching language for writing short programs to perform
data manipulation tasks.
awk
's strength is the manipulation of textual data
that is stored in files.
It was never meant to be used for networking purposes.
To exploit its features in a
networking context, it's necessary to use an access mode for network connections
that resembles the access of files as closely as possible.
awk
is also meant to be a prototyping language. It is used
to demonstrate feasibility and to play with features and user interfaces.
This can be done with file-like handling of network
connections.
gawk
trades the lack
of many of the advanced features of the TCP/IP family of protocols
for the convenience of simple connection handling.
The advanced
features are available when programming in C or Perl. In fact, the
network programming
in this chapter
is very similar to what is described in books such as
Internet Programming with Python,
Advanced Perl Programming,
or
Web Client Programming with Perl.
However, you can do the programming here without first having to learn object-oriented ideology; underlying languages such as Tcl/Tk, Perl, Python; or all of the libraries necessary to extend these languages before they are ready for the Internet.
This chapter demonstrates how to use the TCP protocol. The other protocols are much less important for most users (UDP) or even untractable (RAW).
2.1 gawk 's Networking Mechanisms | How to do gawk networking.
| |
2.2 Establishing a TCP Connection | Making a TCP connection. | |
2.3 Troubleshooting Connection Problems | Troubleshooting TCP/IP connections. | |
2.4 Interacting with a Network Service | Interacting with a service. | |
2.5 Setting Up a Service | Setting up a service. | |
2.6 Reading Email | Reading email. | |
2.7 Reading a Web Page | Reading a Web page. | |
2.8 A Primitive Web Service | A primitive Web service. | |
2.9 A Web Service with Interaction | A Web service with interaction. | |
2.10 A Simple Web Server | A simple Web server. | |
2.11 Network Programming Caveats | Network programming caveats. | |
2.12 Where To Go From Here | Where to go from here. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |