-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the network module prototype
- Loading branch information
Showing
10 changed files
with
743 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Networking Library | ||
|
||
Folder: `./lib_net/` | ||
|
||
Status: Prototype, in review stage | ||
|
||
* This directory contains the Ecstasy code for the standard `net.xtclang.org` module. | ||
* This is not part of the build yet, and is unlikely to compile without the various | ||
minor edits that one would expect to have to perform to get new code to compile. | ||
* This library is intended to serve the `web.xtclang.org` module (and anything else that | ||
needs network communication), but the web module is still undergoing significant | ||
refactoring. | ||
|
||
Example code: | ||
|
||
// the basic idea is that, for the most part, it will be possible to rely on the | ||
// network implementations to be injected | ||
@Inject Network network; | ||
@Inject Network secureNetwork; // for SSL/TLS connections | ||
|
||
assert ServerSocket listenerHTTP := network.listen((IPv6Any, 80)); | ||
assert ServerSocket listenerHTTPS := secureNetwork.listen((IPv6Any, 443)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* The Ecstasy standard module for basic networking support. | ||
*/ | ||
module net.xtclang.org | ||
{ | ||
/** | ||
* | ||
*/ | ||
typedef Tuple<String|IPAddress, UInt16> as HostPort; | ||
|
||
/** | ||
* | ||
*/ | ||
typedef Tuple<IPAddress, UInt16> as SocketAddress; | ||
} |
Oops, something went wrong.