N9I - 2/3/2010
Written on Thu, 04 Feb 2010 07:34:43 +0000 - Last updated on Fri, 05 Feb 2010 07:25:50 +0000A journal entry in the development of the N9I programming language, dated February 3, 2010.
Syntax for creating a server socket with the at operator
The at operator (@) accepts a string in the format host:port. This creates a Provider object representing a connection to the specified host on port port. To do the reverse, that is, create a server socket with the at operator, simply leave the host part blank:
ProviderAlias client = @":80";
Note that, for each incoming client, a separate Provider must be created.
Server socket Providers have similar magic to client socket Providers. For example, if a Provider is created using port 80, N9I will "know" that it is a HTTP provider. The same applies to server sockets - the above Provider is recognized as a HTTP server.