18 TCP Redirect: tcp^ via Channels

▼ |  | Net: Networking Libraries

1 | HTTP Client
2 | URLs and HTTP
3 | URI Codec: Encoding and Decoding URIs
4 | FTP: Client
5 | Send URL: Opening a Web Browser
6 | SMTP: Sending E-Mail
7 | sendmail: Sending E-Mail
8 | Headers: Parsing and Constructing
9 | Header Field Encoding
10 | IMAP: Reading Mail
11 | POP3: Reading Mail
12 | MIME: Decoding Internet Data
13 | Base 64: Encoding and Decoding
14 | Quoted-Printable: Encoding and Decoding
15 | DNS: Domain Name Service Queries
16 | NNTP: Newsgroup Protocol
17 | TCP: Unit and Signature
18 | TCP Redirect: tcp^ via Channels
19 | SSL Unit: tcp^ via SSL
20 | CGI Scripts
21 | Cookie: Legacy HTTP Client Storage
22 | Git Repository Checkout
| Bibliography
| Index

On this page:

tcp-redirect

Racket
top contents ← prev up next →

## 18 TCP Redirect: tcp^ via Channels🔗ℹ

(require net/tcp-redirect) | package: net-lib

The net/tcp-redirect library provides a function for directing some TCP port numbers to use buffered channels instead of the TCP support from racket/tcp.

> procedure (tcp-redirect port-numbers) → unit?
> port-numbers : (listof (integer-in 0 65535))

Returns a unit that implements tcp^. For port numbers not listed in port-numbers, the unit’s implementations are the racket/tcp implementations.

For the port numbers listed in port-numbers and for connections to "127.0.0.1", the unit’s implementation does not use TCP connections, but instead uses internal buffered channels. Such channels behave exactly as TCP listeners and ports.

top contents ← prev up next →