<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://m204wiki.rocketsoftware.com/index.php?action=history&amp;feed=atom&amp;title=Sample_Janus_Sockets_programs</id>
	<title>Sample Janus Sockets programs - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://m204wiki.rocketsoftware.com/index.php?action=history&amp;feed=atom&amp;title=Sample_Janus_Sockets_programs"/>
	<link rel="alternate" type="text/html" href="https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;action=history"/>
	<updated>2026-04-18T05:54:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=59137&amp;oldid=prev</id>
		<title>JAL: /* See also */</title>
		<link rel="alternate" type="text/html" href="https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=59137&amp;oldid=prev"/>
		<updated>2013-04-26T15:14:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See also&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:14, 26 April 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l461&quot;&gt;Line 461:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 461:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Janus Sockets User Language coding considerations]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Socket-level interfaces:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Socket-level interfaces:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JAL</name></author>
	</entry>
	<entry>
		<id>https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=59117&amp;oldid=prev</id>
		<title>JAL: /* See also */</title>
		<link rel="alternate" type="text/html" href="https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=59117&amp;oldid=prev"/>
		<updated>2013-04-25T19:13:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;See also&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:13, 25 April 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l461&quot;&gt;Line 461:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 461:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See also==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==See also==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Sample Janus Sockets programs]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Socket-level interfaces:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;li&amp;gt;Socket-level interfaces:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ul&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JAL</name></author>
	</entry>
	<entry>
		<id>https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=59107&amp;oldid=prev</id>
		<title>JAL: /* Print capturing example */</title>
		<link rel="alternate" type="text/html" href="https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=59107&amp;oldid=prev"/>
		<updated>2013-04-25T19:08:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Print capturing example&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:08, 25 April 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l458&quot;&gt;Line 458:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 458:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;End&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;End&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==See also==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;ul&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Sample Janus Sockets programs]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;Socket-level interfaces:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;ul&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Janus Sockets $functions|$functions]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Socket class]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;Higher-level interfaces: &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;ul&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Email class]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[HTTP Helper|HTTP Helper classes]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[LDAP class]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Janus FTP Server]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;li&amp;gt;[[Janus Telnet Server]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Janus Sockets]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Janus Sockets]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JAL</name></author>
	</entry>
	<entry>
		<id>https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=50011&amp;oldid=prev</id>
		<title>JAL2: Created page with &quot;==Retrieving web pages: HTTP, HTML== The examples in this section show techniques for composing HTTP requests, sending them to a web server, and retrieving the response.   The cu...&quot;</title>
		<link rel="alternate" type="text/html" href="https://m204wiki.rocketsoftware.com/index.php?title=Sample_Janus_Sockets_programs&amp;diff=50011&amp;oldid=prev"/>
		<updated>2012-02-14T22:52:31Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Retrieving web pages: HTTP, HTML== The examples in this section show techniques for composing HTTP requests, sending them to a web server, and retrieving the response.   The cu...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Retrieving web pages: HTTP, HTML==&lt;br /&gt;
The examples in this section show techniques for composing HTTP requests,&lt;br /&gt;
sending them to a web server, and retrieving the response.&lt;br /&gt;
 &lt;br /&gt;
The current specification for HTTP ([http:///www.w3.org/Protocols/rfc2616/rfc2616.html HTTP/1.1])&lt;br /&gt;
gives something like the following simple structure for using HTTP:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Client (&amp;quot;browser&amp;quot;) sends a request, which contains:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The request line, ended by CRLF (x&amp;#039;0D0A&amp;#039;), and containing:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The method, for example, GET to get a web page&lt;br /&gt;
&amp;lt;li&amp;gt;The ID, or &amp;quot;URL&amp;quot;&lt;br /&gt;
&amp;lt;li&amp;gt;The protocol version, for example, HTTP/1.1&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Additional header lines, each ended by CRLF&lt;br /&gt;
&amp;lt;li&amp;gt;An empty line, that is, an immediate CRLF&lt;br /&gt;
&amp;lt;li&amp;gt;The body&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Server interprets the request and sends a response, which contains:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The response status line, ended by CRLF, and containing:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The HTTP version ID (for example, HTTP/1.1), followed by spaces&lt;br /&gt;
&amp;lt;li&amp;gt;The status code number, followed by spaces&lt;br /&gt;
&amp;lt;li&amp;gt;The status code message&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Additional header lines, each ended by CRLF&lt;br /&gt;
&amp;lt;li&amp;gt;An empty line, that is, an immediate CRLF&lt;br /&gt;
&amp;lt;li&amp;gt;The body&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Header lines contain a case-insensitive field name, followed by a colon (&amp;lt;tt&amp;gt;:&amp;lt;/tt&amp;gt;),&lt;br /&gt;
and spaces followed by the field value.&lt;br /&gt;
 &lt;br /&gt;
The ASCII string of carriage-return followed by linefeed (0D0A) is&lt;br /&gt;
used in the HTTP protocol to separate header lines and to separate the header from the body.&lt;br /&gt;
The response body is the web &amp;quot;page,&amp;quot;&lt;br /&gt;
which may contain a variety of data.&lt;br /&gt;
Frequently, the page will contain HTML, which is frequently separated into&lt;br /&gt;
&amp;quot;lines;&amp;quot; however, the separators of the lines are commonly either 0D0A, 0D, or 0A.&lt;br /&gt;
Although this presents ambiguous parse tokens, as discussed in [[#Ambiguous PRSTOK strings|&amp;quot;Ambiguous PRSTOK strings&amp;quot;]],&lt;br /&gt;
the pitfalls of the general request-response protocols do not apply with a single&lt;br /&gt;
request-response when the only ambiguity occurs in the response stream.&lt;br /&gt;
 &lt;br /&gt;
===Simple echo of HTTP/HTML===&lt;br /&gt;
This example shows a complete program that communicates with a remote&lt;br /&gt;
web server and that parses and prints the returned HTML stream.&lt;br /&gt;
 &lt;br /&gt;
Note that the third argument to &amp;lt;var&amp;gt;[[$Sock_RecvPrs]]&amp;lt;/var&amp;gt; is -1, which means that there&lt;br /&gt;
is no limit to the length of each line parsed, hence no limit to the number of bytes discarded&lt;br /&gt;
at the end of the line (only the first 78 bytes (&amp;lt;code&amp;gt;%s&amp;lt;/code&amp;gt; size) of each line of HTML is examined&lt;br /&gt;
by the &amp;lt;var class=&amp;quot;product&amp;quot;&amp;gt;User Language&amp;lt;/var&amp;gt; program).&lt;br /&gt;
[[#Echo of HTTP/HTML with continuation lines|&amp;quot;Echo of HTTP/HTML with continuation lines&amp;quot;]]&lt;br /&gt;
has an example that examines complete lines, printing continuation lines as needed.&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;JANUS DEFINE MYBROWSE * CLSOCK 60 REMOTE * 80 LINEND 0D0A&lt;br /&gt;
JANUS START MYBROWSE&lt;br /&gt;
Begin&lt;br /&gt;
   %socket Is Float&lt;br /&gt;
   %rc     Is Float&lt;br /&gt;
   %host   Is String Len 255&lt;br /&gt;
   %page   Is String Len 255&lt;br /&gt;
   %s      Is String Len  78&lt;br /&gt;
   %host   = &amp;#039;www.sirius-software.com&amp;#039;&lt;br /&gt;
   %page   = &amp;#039;main.html&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
   %socket = $sock_conn(&amp;#039;TEST&amp;#039;, %host)&lt;br /&gt;
   If %socket Lt 0 Then&lt;br /&gt;
      Stop&lt;br /&gt;
   End If&lt;br /&gt;
   %rc = $sock_send(%socket, &amp;#039;GET /&amp;#039;)&lt;br /&gt;
   %rc = $sock_send(%socket, %page)&lt;br /&gt;
   %rc = $sock_sendln(%socket, &amp;#039; HTTP/1.0&amp;#039;)&lt;br /&gt;
   &amp;amp;#42; Null line indicates end of request:&lt;br /&gt;
   %rc = $sock_sendln(%socket, &amp;#039;&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
   %s = $sock_set(%socket, &amp;#039;PRSTOK&amp;#039;, &amp;#039;AMBIG|0D0A|0A|0D&amp;#039;)&lt;br /&gt;
   Repeat&lt;br /&gt;
      %rc = $sock_recvprs(%socket, %s, -1)&lt;br /&gt;
      Print %s&lt;br /&gt;
      If %rc Le 0 Then&lt;br /&gt;
         Loop End&lt;br /&gt;
      End If&lt;br /&gt;
   End Repeat&lt;br /&gt;
   %rc = $sock_close(%socket)&lt;br /&gt;
End&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Echo of HTTP/HTML with continuation lines===&lt;br /&gt;
This example shows a complete program that communicates with a remote&lt;br /&gt;
web server and which parses and prints the returned HTML stream.&lt;br /&gt;
This program differs from that in&lt;br /&gt;
[[#Simple echo of HTTP/HTML|&amp;quot;imple echo of HTTP/HTML&amp;quot;] because it examines complete lines,&lt;br /&gt;
printing continuation lines as needed.&lt;br /&gt;
 &lt;br /&gt;
The fourth argument to &amp;lt;var&amp;gt;[[$Sock_RecvPrs]]&amp;lt;/var&amp;gt; (&amp;lt;code&amp;gt;%x&amp;lt;/code&amp;gt; in the example below) is&lt;br /&gt;
the index of the separator string found in the received data.&lt;br /&gt;
When this value is 0, it means that, within the data that has&lt;br /&gt;
been received upon return from &amp;lt;var&amp;gt;$Sock_RecvPrs&amp;lt;/var&amp;gt;, no separator has been found.&lt;br /&gt;
This indicates one of the following:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;All data has been received (or all&lt;br /&gt;
data within &amp;lt;var&amp;gt;RECVLIM&amp;lt;/var&amp;gt;, which is not used in this example)&lt;br /&gt;
&amp;lt;li&amp;gt;The limit set by its third argument (here defaulting to 0, which means&lt;br /&gt;
the size of the second argument) caused &amp;lt;var&amp;gt;$Sock_RecvPrs&amp;lt;/var&amp;gt; to return before it&lt;br /&gt;
might have found a separator.&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This information (&amp;lt;code&amp;gt;%x Eq 0&amp;lt;/code&amp;gt;) works adequately for the example.&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;JANUS DEFINE MYBROWSE * CLSOCK 60 REMOTE * 80 LINEND 0D0A&lt;br /&gt;
JANUS START MYBROWSE&lt;br /&gt;
Begin&lt;br /&gt;
   %socket Is Float&lt;br /&gt;
   %rc     Is Float&lt;br /&gt;
   %x      Is Float&lt;br /&gt;
   %host   Is String Len 255&lt;br /&gt;
   %page   Is String Len 255&lt;br /&gt;
   %s      Is String Len  75&lt;br /&gt;
   %pre    Is String Len  2&lt;br /&gt;
   %host   = &amp;#039;www.sirius-software.com&amp;#039;&lt;br /&gt;
   %page   = &amp;#039;main.html&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
   %socket = $sock_conn(&amp;#039;TEST&amp;#039;, %host)&lt;br /&gt;
   If %socket Lt 0 Then&lt;br /&gt;
      Stop&lt;br /&gt;
   End If&lt;br /&gt;
   %rc = $sock_send(%socket, &amp;#039;GET /&amp;#039;)&lt;br /&gt;
   %rc = $sock_send(%socket, %page)&lt;br /&gt;
   %rc = $sock_sendln(%socket, &amp;#039; HTTP/1.0&amp;#039;)&lt;br /&gt;
   &amp;amp;#42; Null line indicates end of request:&lt;br /&gt;
   %rc = $sock_sendln(%socket, &amp;#039;&amp;#039;)&lt;br /&gt;
 &lt;br /&gt;
   %s = $sock_set(%socket, &amp;#039;PRSTOK&amp;#039;, &amp;#039;AMBIG|0D0A|0A|0D&amp;#039;)&lt;br /&gt;
   %pre    = &amp;#039;  &amp;#039;&lt;br /&gt;
   Repeat&lt;br /&gt;
      %rc = $sock_recvprs(%socket, %s, , %x)&lt;br /&gt;
      Print %pre And %s&lt;br /&gt;
      If %rc Le 0 Then&lt;br /&gt;
         Loop End&lt;br /&gt;
      End If&lt;br /&gt;
      %pre = &amp;#039;  &amp;#039;&lt;br /&gt;
      If %x Eq 0 Then&lt;br /&gt;
         %pre = &amp;#039;-&amp;gt;&amp;#039;&lt;br /&gt;
      End If&lt;br /&gt;
   End Repeat&lt;br /&gt;
   %rc = $sock_close(%socket)&lt;br /&gt;
End&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
==Request-response protocol==&lt;br /&gt;
The first parts of this section exhibit a very simple&lt;br /&gt;
protocol which can be used between any two sockets platforms.&lt;br /&gt;
This example is shown using &amp;lt;var class=&amp;quot;product&amp;quot;&amp;gt;Janus Sockets&amp;lt;/var&amp;gt; for both the client and&lt;br /&gt;
server, but either the client or the server portion can be easily&lt;br /&gt;
implemented on any platform with a sockets interface.&lt;br /&gt;
 &lt;br /&gt;
This protocol makes use of the &amp;lt;var&amp;gt;[[$Sock_RecvPrs]]&amp;lt;/var&amp;gt; function to receive the&lt;br /&gt;
client request and server response.&lt;br /&gt;
The request consists of multiple strings, each&lt;br /&gt;
separated by an &amp;quot;end of line&amp;quot; sequence.&lt;br /&gt;
This is a natural sequence for various platforms;&lt;br /&gt;
for example, you might want to copy the contents of a text file as some of the data in the request.&lt;br /&gt;
 &lt;br /&gt;
In some environments, end of line is &amp;lt;code&amp;gt;X&amp;#039;0D&amp;#039;&amp;lt;/code&amp;gt; and in others &amp;lt;code&amp;gt;X&amp;#039;0D0A&amp;#039;&amp;lt;/code&amp;gt;.&lt;br /&gt;
Since one line-end alternative is a prefix of another, it is necessary to&lt;br /&gt;
use the &amp;lt;var&amp;gt;AMBIG&amp;lt;/var&amp;gt; specification on the &amp;lt;var&amp;gt;PRSTOK&amp;lt;/var&amp;gt; parameter.&lt;br /&gt;
The last part of this section ([[#Ambiguous PRSTOK strings|&amp;quot;Ambiguous PRSTOK strings&amp;quot;]])&lt;br /&gt;
discusses some considerations for ambiguous &amp;lt;var&amp;gt;PRSTOK&amp;lt;/var&amp;gt; parameters.&lt;br /&gt;
 &lt;br /&gt;
===Single request client code===&lt;br /&gt;
This client sends a single request and receives a response.&lt;br /&gt;
A request contains an action, followed by the data for the request,&lt;br /&gt;
followed by a distinct line for the end of the request.&lt;br /&gt;
After sending the request, it receives the response from the server.&lt;br /&gt;
 &lt;br /&gt;
This example could easily be written for another sockets platform,&lt;br /&gt;
and the data could be conveniently obtained from a text file.&lt;br /&gt;
 &lt;br /&gt;
As discussed in [[#Ambiguous PRSTOK strings|&amp;quot;Ambiguous PRSTOK strings&amp;quot;]], it is important to use an&lt;br /&gt;
unambiguous separator string at the end of the request, one that&lt;br /&gt;
is not a prefix of any other separator.&lt;br /&gt;
In our protocol, we are using a single byte of hex 07 (the ASCII &amp;quot;Bell&amp;quot; character) as this&lt;br /&gt;
separator to &amp;quot;turn around&amp;quot; the connection from both the client and server perspective.&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;JANUS DEFINE SOCKA * CLSOCK 10 REMOTE SOCKA_SRV 7733&lt;br /&gt;
JANUS START SOCKA&lt;br /&gt;
Begin&lt;br /&gt;
%x Float&lt;br /&gt;
%r Float&lt;br /&gt;
%status String Len 10&lt;br /&gt;
%x = $sock_conn(&amp;#039;SOCKA&amp;#039;)&lt;br /&gt;
If %x Lt 0 Then&lt;br /&gt;
   Stop&lt;br /&gt;
End If&lt;br /&gt;
%r = $sock_sendln(%X, &amp;#039;ACTION1&amp;#039;)&lt;br /&gt;
Fr Where RECTYPE = &amp;#039;MYDATA&amp;#039;&lt;br /&gt;
   %r = $sock_sendln(%x, DATA)&lt;br /&gt;
End For&lt;br /&gt;
%r = $sock_sendln(%x, &amp;#039;GO&amp;#039;, &amp;#039;LINEnd 07&amp;#039;)&lt;br /&gt;
%r = $sock_recvprs(%x, %status, , &amp;#039;PRSTOK 07&amp;#039;)&lt;br /&gt;
If %status Ne &amp;#039;GOOD&amp;#039; Then&lt;br /&gt;
   Stop&lt;br /&gt;
End If&lt;br /&gt;
%r = $sock_close(%x)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
===Single request server code===&lt;br /&gt;
The server receives a single request and sends a response.&lt;br /&gt;
See details about the protocol in [[#Single request client code|&amp;quot;Single request client code&amp;quot;]].&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt;&lt;br /&gt;
As always, the connection initiating &amp;lt;var&amp;gt;SRVSOCK&amp;lt;/var&amp;gt; processing is accessible as socket number 1.&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;JANUS DEFINE SOCKS 7733 SRVSOCK 10 CMD &amp;#039;INCLUDE SINGLE_REQ&amp;#039;&lt;br /&gt;
JANUS START SOCKS&lt;br /&gt;
PROCEDURE SINGLE_REQ&lt;br /&gt;
Begin&lt;br /&gt;
%r Float&lt;br /&gt;
%sepx Float&lt;br /&gt;
%data String Len 255&lt;br /&gt;
%r = $sock_set(1, &amp;#039;PRSTOK&amp;#039;, &amp;#039;AMBIG|0D0A|0D|0A|07&amp;#039;)&lt;br /&gt;
%r = $sock_set(1, &amp;#039;LINEND&amp;#039;, &amp;#039;07&amp;#039;)&lt;br /&gt;
%r = $sock_recvprs(1, %data)&lt;br /&gt;
If %r Le 0 Then&lt;br /&gt;
   Stop&lt;br /&gt;
End If&lt;br /&gt;
If %data Eq &amp;#039;ACTION1&amp;#039; Then&lt;br /&gt;
   Repeat&lt;br /&gt;
      %r = $sock_Recvprs(1, %data, %sepx)&lt;br /&gt;
      If %r Le 0 Then&lt;br /&gt;
         Stop&lt;br /&gt;
      Elseif %sepx Le 4 Then&lt;br /&gt;
         If %data Ne &amp;#039;GO&amp;#039; Then&lt;br /&gt;
            %r = $sock_sendln(1, &amp;#039;BAD&amp;#039;)&lt;br /&gt;
         Else&lt;br /&gt;
            %r = $sock_sendln(1, &amp;#039;GOOD&amp;#039;)&lt;br /&gt;
         End If&lt;br /&gt;
         Stop&lt;br /&gt;
      End If&lt;br /&gt;
      ... processing a line of data&lt;br /&gt;
   End Repeat&lt;br /&gt;
Else If %data Eq ...  other operation&lt;br /&gt;
   Repeat&lt;br /&gt;
      %r = $sock_recvprs(1, %data, %sepx)&lt;br /&gt;
      ... (same structure as above)&lt;br /&gt;
   End Repeat&lt;br /&gt;
Else If %data Eq ...  other operations&lt;br /&gt;
   ...&lt;br /&gt;
End If&lt;br /&gt;
%r = $sock_close(1)&lt;br /&gt;
End&lt;br /&gt;
END PROCEDURE&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
===Multiple request client code===&lt;br /&gt;
This client sends a series of requests and receives a response from each one.&lt;br /&gt;
The protocol is the same as shown in [[#Single request client code|&amp;quot;Single request client code&amp;quot;]], except that&lt;br /&gt;
at the end of the series of requests it sends a special action to&lt;br /&gt;
indicate the end of the conversation.&lt;br /&gt;
 &lt;br /&gt;
In this example, the use of the unambiguous separator at the end of&lt;br /&gt;
the response is more important than in the previous example, because&lt;br /&gt;
the server is going to receive after sending the response.&lt;br /&gt;
With a single request-response protocol, as long as you are sure that&lt;br /&gt;
the server will close the connection after sending the response, the&lt;br /&gt;
client will receive the complete response even if it is terminated by an ambiguous separator.&lt;br /&gt;
 &lt;br /&gt;
It is good practice, however, to use unambiguous separators to end&lt;br /&gt;
each request and response, since, for example, the server may be poorly&lt;br /&gt;
designed and the connection could stay open for an extended time.&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;JANUS DEFINE SOCKA * CLSOCK 10 REMOTE SOCKA_SRV 7733&lt;br /&gt;
JANUS START SOCKA&lt;br /&gt;
Begin&lt;br /&gt;
%x Float&lt;br /&gt;
%r Float&lt;br /&gt;
%status String Len 10&lt;br /&gt;
%x = $sock_conn(&amp;#039;SOCKA&amp;#039;)&lt;br /&gt;
If %x Lt 0 Then&lt;br /&gt;
   Stop&lt;br /&gt;
End If&lt;br /&gt;
%r = $sock_set(%x, &amp;#039;PRSTOK&amp;#039;, &amp;#039;07&amp;#039;)&lt;br /&gt;
Fr Where RECTYPE = &amp;#039;REQUEST&amp;#039;&lt;br /&gt;
   %r = $sock_sendln(%x, REQ_TYPE)&lt;br /&gt;
   D: FEO DATA_LINE&lt;br /&gt;
      %r = $sock_sendln(%x, VALUE IN D)&lt;br /&gt;
   End For&lt;br /&gt;
   %r = $sock_sendln(%x, &amp;#039;GO&amp;#039;, &amp;#039;LINEND 07&amp;#039;)&lt;br /&gt;
   %r = $sock_recvprs(%x, %status)&lt;br /&gt;
   If %status Ne &amp;#039;GOOD&amp;#039; Then&lt;br /&gt;
      Stop&lt;br /&gt;
   End If&lt;br /&gt;
End For&lt;br /&gt;
%r = $sock_sendln(%x, &amp;#039;DONE&amp;#039;)&lt;br /&gt;
%r = $sock_close(%x)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
===Multiple request server code===&lt;br /&gt;
The server receives a series of requests and sends a response for each one.&lt;br /&gt;
The protocol is the same as shown in [[#Single request client code|&amp;quot;Single request client code&amp;quot;]], except that&lt;br /&gt;
at the end of the series of requests the client sends a special action to&lt;br /&gt;
indicate the end of the conversation.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;b&amp;gt;Note:&amp;lt;/b&amp;gt;&lt;br /&gt;
As always, the connection initiating &amp;lt;var&amp;gt;SRVSOCK&amp;lt;/var&amp;gt; processing is&lt;br /&gt;
accessible as socket number 1.&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;JANUS DEFINE SOCKS 7733 SRVSOCK 10 CMD &amp;#039;INCLUDE MULTIPLE_REQ&amp;#039;&lt;br /&gt;
JANUS START SOCKS&lt;br /&gt;
PROCEDURE MULTIPLE_REQ&lt;br /&gt;
Begin&lt;br /&gt;
%r Float&lt;br /&gt;
%sepx Float&lt;br /&gt;
%data String Len 255&lt;br /&gt;
%r = %sock_set(1, &amp;#039;PRSTOK&amp;#039;, &amp;#039;AMBIG|0D0A|0D|0A|07&amp;#039;)&lt;br /&gt;
%r = %sock_set(1, &amp;#039;LINEND&amp;#039;, &amp;#039;07&amp;#039;)&lt;br /&gt;
Repeat&lt;br /&gt;
   %r = %sock_recvprs(1, %data)&lt;br /&gt;
   If %r Le 0 Then&lt;br /&gt;
      Loop End&lt;br /&gt;
   End If&lt;br /&gt;
   If %data Eq &amp;#039;DONE&amp;#039; Then&lt;br /&gt;
      Loop End&lt;br /&gt;
   Elseif %data Eq &amp;#039;ACTION1&amp;#039; Then&lt;br /&gt;
      Repeat&lt;br /&gt;
         %r = %sock_recvprs(1, %data, %sepx)&lt;br /&gt;
         If %r Le 0 Then&lt;br /&gt;
            Stop&lt;br /&gt;
         Elseif %sepx Eq 4 Then&lt;br /&gt;
            If %data Eq &amp;#039;DONE&amp;#039; Then&lt;br /&gt;
               %r = %sock_sendln(1, &amp;#039;BAD&amp;#039;)&lt;br /&gt;
               Loop End&lt;br /&gt;
            End If&lt;br /&gt;
            %r = %sock_sendln(1, &amp;#039;GOOD&amp;#039;)&lt;br /&gt;
            Loop End&lt;br /&gt;
         End&lt;br /&gt;
         ... processing a line of data&lt;br /&gt;
      End Repeat&lt;br /&gt;
   Else If %data Eq ...  another operation&lt;br /&gt;
      Repeat&lt;br /&gt;
         %r = %sock_recvprs(1, %data, %sepx)&lt;br /&gt;
         ... (same structure as above)&lt;br /&gt;
      End Repeat&lt;br /&gt;
   Else If %data Eq ...  other operations&lt;br /&gt;
   ...&lt;br /&gt;
   End If&lt;br /&gt;
End Repeat&lt;br /&gt;
%r = %sock_close(1)&lt;br /&gt;
End&lt;br /&gt;
END PROCEDURE&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
===Ambiguous PRSTOK strings===&lt;br /&gt;
In the example code shown in the preceding sections, the lines of data are sent with&lt;br /&gt;
either CRLF, CR, or LF (0D0A|0D|0A) separating them, but the line that signals the end of&lt;br /&gt;
a request is terminated with hex 07.&lt;br /&gt;
The separators &amp;lt;code&amp;gt;0D0A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;0D&amp;lt;/code&amp;gt; are &amp;#039;&amp;#039;&amp;#039;ambiguous&amp;#039;&amp;#039;&amp;#039; because &amp;lt;code&amp;gt;0D&amp;lt;/code&amp;gt; is a&lt;br /&gt;
prefix of &amp;lt;code&amp;gt;0D0A&amp;lt;/code&amp;gt;.&lt;br /&gt;
When a &amp;lt;code&amp;gt;0D&amp;lt;/code&amp;gt; is received, &amp;lt;var class=&amp;quot;product&amp;quot;&amp;gt;Janus Sockets&amp;lt;/var&amp;gt; waits until it receives an additional byte&lt;br /&gt;
to distinguish which of the two separators was sent.&lt;br /&gt;
The unambiguous 07 is used in the example in [[#Multiple request client code|&amp;quot;Multiple request client code&amp;quot;]]&lt;br /&gt;
to end the &amp;lt;code&amp;gt;GO&amp;lt;/code&amp;gt; line, because using an ambiguous separator when&lt;br /&gt;
going from send to receive mode can cause both sides to wait for data that is not forthcoming.&lt;br /&gt;
 &lt;br /&gt;
In a request-response protocol, when one side finishes sending (the&lt;br /&gt;
client finishes a request, or the server finishes a response), it then&lt;br /&gt;
does a receive (the client to get the response, the server to get the next request).&lt;br /&gt;
When either side does the receive, it must be ensured that the other side does not&lt;br /&gt;
continue to wait for data on its own receive.&lt;br /&gt;
Otherwise, both sides are receiving and nothing is being sent for them to receive.&lt;br /&gt;
In this case, they could wait forever, until the &amp;lt;var&amp;gt;TIMEOUT&amp;lt;/var&amp;gt; value expires at one side or the other,&lt;br /&gt;
or until (using &amp;lt;var class=&amp;quot;product&amp;quot;&amp;gt;Model 204&amp;lt;/var&amp;gt;) one side is bumped.&lt;br /&gt;
 &lt;br /&gt;
If the server accepts 0D0A|0D|0A (or even just 0D0A|0D) as the terminator&lt;br /&gt;
of the &amp;lt;code&amp;gt;GO&amp;lt;/code&amp;gt; line, and the client sends &amp;lt;code&amp;gt;0D&amp;lt;/code&amp;gt; as its &amp;lt;var&amp;gt;LINEND&amp;lt;/var&amp;gt; and&lt;br /&gt;
then does a receive, the server will wait to receive a byte after the&lt;br /&gt;
&amp;lt;code&amp;gt;0D&amp;lt;/code&amp;gt; to determine whether the separator was &amp;lt;code&amp;gt;0D0A&amp;lt;/code&amp;gt; or just &amp;lt;code&amp;gt;0D&amp;lt;/code&amp;gt;.&lt;br /&gt;
This situation where both sides wait forever is avoided by using an unambiguous separator&lt;br /&gt;
(&amp;lt;code&amp;gt;07&amp;lt;/code&amp;gt; in this case) as the terminator of the &amp;lt;code&amp;gt;GO&amp;lt;/code&amp;gt; line.&lt;br /&gt;
Similarly, the multiple request server uses the unambiguous &amp;lt;code&amp;gt;07&amp;lt;/code&amp;gt; to terminate the response, so that&lt;br /&gt;
the client can send the next request.&lt;br /&gt;
 &lt;br /&gt;
If possible, use unambiguous separators when designing your protocols.&lt;br /&gt;
If that is very inconvenient, such as the case of copying text files with the&lt;br /&gt;
ambiguous linend 0D0A|0D|0A strings, you must use the &amp;lt;code&amp;gt;AMBIG|&amp;lt;/code&amp;gt; specification&lt;br /&gt;
at the start of your &amp;lt;var&amp;gt;PRSTOK&amp;lt;/var&amp;gt; string, and you should take special care when composing&lt;br /&gt;
the terminator of a line that is the last one before a switch to do a receive.&lt;br /&gt;
The &amp;lt;code&amp;gt;AMBIG|&amp;lt;/code&amp;gt; indicator highlights the necessity to ensure that your&lt;br /&gt;
protocol, that is, the sockets application processing logic, avoids the pitfalls&lt;br /&gt;
introduced by ambiguous separators.&lt;br /&gt;
 &lt;br /&gt;
Since &amp;lt;code&amp;gt;0A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;0D0A&amp;lt;/code&amp;gt; are not prefixes of another separator, either&lt;br /&gt;
could be used as &amp;lt;code&amp;gt;GO&amp;lt;/code&amp;gt; terminator, if the line &amp;lt;code&amp;gt;GO&amp;lt;/code&amp;gt; is guaranteed&lt;br /&gt;
not to occur as a data line.&lt;br /&gt;
The server code (for example,&lt;br /&gt;
in [[#Single request server code|&amp;quot;Single request server code&amp;quot;]]) uses the extra protection of a unique&lt;br /&gt;
line and a unique separator to double-check that the client is not violating the protocol.&lt;br /&gt;
 &lt;br /&gt;
Again, the &amp;quot;wait forever&amp;quot; problem that ambiguous separators may produce only&lt;br /&gt;
applies to a separator that occurs at a send/receive boundary.&lt;br /&gt;
Thus, as mentioned in [[#Retrieving web pages: HTTP, HTML|&amp;quot;Retrieving web pages: HTTP, HTML&amp;quot;]], a&lt;br /&gt;
single request-response protocol presents no problems if the only ambiguity&lt;br /&gt;
is in the response stream.&lt;br /&gt;
 &lt;br /&gt;
Other than &amp;quot;wait forever&amp;quot; problems, the other question raised by ambiguous separators concerns null &amp;quot;lines.&amp;quot;&lt;br /&gt;
The simple rule is that the longest separator possible is chosen.&lt;br /&gt;
So, consider the following somewhat silly client code that &amp;quot;hand codes&amp;quot; its separators:&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;%r = $sock_send(%sok, &amp;#039;Line 1&amp;#039;)&lt;br /&gt;
%r = $sock_send(%sok, $x2c(&amp;#039;0D&amp;#039;), &amp;#039;BINARY&amp;#039;)&lt;br /&gt;
%line2 = &amp;#039;&amp;#039;&lt;br /&gt;
%r = $sock_send(%sok, %line2)&lt;br /&gt;
%r = $sock_send(%sok, $X2C(&amp;#039;0A&amp;#039;), &amp;#039;BINARY&amp;#039;)&lt;br /&gt;
%r = $sock_send(%sok, &amp;#039;Line 3&amp;#039;)&lt;br /&gt;
%r = $sock_send(%sok, $x2c(&amp;#039;0D07&amp;#039;), &amp;#039;BINARY&amp;#039;)&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
If the corresponding server code is:&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;%r = $sock_set(1, &amp;#039;PRSTOK&amp;#039;, &amp;#039;AMBIG|0D0A|0D|0A|07&amp;#039;)&lt;br /&gt;
Repeat&lt;br /&gt;
   %r = $sock_recv(1, %targ)&lt;br /&gt;
   If %r Le 0 Then&lt;br /&gt;
      Loop End&lt;br /&gt;
   End&lt;br /&gt;
   Print &amp;#039;Length &amp;#039; $Len(%targ) &amp;#039;: &amp;#039; %targ&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
The results will be:&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;Length 6: Line 1&lt;br /&gt;
Length 6: Line 3&lt;br /&gt;
Length 0:&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
What might appear to be the sending of three lines by the client, with&lt;br /&gt;
the second line null, is actually seen by the server as two lines, because&lt;br /&gt;
the hexadecimal string &amp;lt;code&amp;gt;0D0A&amp;lt;/code&amp;gt; is seen as one separator, not two.&lt;br /&gt;
&lt;br /&gt;
===Print capturing example===&lt;br /&gt;
 &lt;br /&gt;
This example shows the use of print capturing.&lt;br /&gt;
This application uses &amp;lt;var&amp;gt;WRITE IMAGE ON TERMINAL&amp;lt;/var&amp;gt; for output, which might&lt;br /&gt;
be appropriate, for example, in a &amp;lt;var&amp;gt;BATCH2&amp;lt;/var&amp;gt; input stream.&lt;br /&gt;
 &lt;br /&gt;
Note that the final &amp;lt;var&amp;gt;Print&amp;lt;/var&amp;gt; statement goes to the terminal, since&lt;br /&gt;
there are no sockets with print captured at that point.&lt;br /&gt;
 &lt;br /&gt;
For more information about print capturing, see [[$Sock_Capture#Print capturing hierarchy and other considerations|&amp;quot;Print capturing hierarchy and other considerations&amp;quot;]].&lt;br /&gt;
&amp;lt;p class=&amp;quot;code&amp;quot;&amp;gt;Begin&lt;br /&gt;
IMAGE LIN&lt;br /&gt;
S IS STRING LEN 255&lt;br /&gt;
END IMAGE&lt;br /&gt;
OPEN TERMINAL FOR OUTPUT&lt;br /&gt;
%sock = $sock_conn(&amp;#039;SOCKEM&amp;#039;)&lt;br /&gt;
If %sock Lt 0 Then&lt;br /&gt;
   Stop&lt;br /&gt;
End If&lt;br /&gt;
%s = $sock_capture(%sock, &amp;#039;ON&amp;#039;)&lt;br /&gt;
Prepare Image LIN&lt;br /&gt;
Print &amp;#039;Hello, world!&amp;#039;&lt;br /&gt;
%lin:S = &amp;#039;Look at me - I sent a line!&amp;#039;&lt;br /&gt;
Write Image LIN On Terminal&lt;br /&gt;
Print &amp;#039;Goodbye, world!&amp;#039;&lt;br /&gt;
%x = $sock_close&lt;br /&gt;
Print &amp;#039;Mission accomplished&amp;#039;&lt;br /&gt;
End&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Janus Sockets]]&lt;/div&gt;</summary>
		<author><name>JAL2</name></author>
	</entry>
</feed>