File: tapi-c36.htm

package info (click to toggle)
aolserver 3.4.2-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 22,692 kB
  • ctags: 33,612
  • sloc: ansic: 171,340; tcl: 10,218; sh: 3,821; cpp: 2,779; makefile: 2,041; yacc: 1,648; perl: 456; php: 13
file content (139 lines) | stat: -rw-r--r-- 6,270 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<HTML><HEAD>
<TITLE>Tcl API Reference -- ns_conn</TITLE>
<LINK rel=Previous href="tapi-c35.htm">
<LINK rel=ToC href="toc.htm">
<LINK rel=Index href="master.htm">
<LINK rel=Next href="tapi-c37.htm">
</HEAD><BODY BGCOLOR="#ffffff"><A NAME="topofpage"></A>
<TABLE WIDTH=100%>
  <TR>
    <TD ALIGN=LEFT>
      <A NAME="topofpage"></A> <IMG  SRC="as-c-sm.gif">
    </TD>
    <TD ALIGN=RIGHT>
      <A href="tapi-c35.htm"><IMG  BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
      <A href=toc.htm> <IMG  BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
      <A href=master.htm> <IMG  BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
      <A href="tapi-c37.htm"> <IMG  BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
      <A name="7983"> </A>
    </TD>
  </TR>
</TABLE>

<a name="3206">
</a><h3>ns_conn</h3>
<a name="3208">
</a><h4>Overview</h4>
<p><a name="3214">
</a>Find information about the current HTTP connection.</p>
<a name="3216">
</a><h4>Syntax</h4>
<p><a name="133282">
</a><b>ns_conn authpassword</b></p>
<p><a name="133276">
</a><b>ns_conn authuser</b></p>
<p><a name="198822">
</a><b>ns_conn close</b></p>
<p><a name="133314">
</a><b>ns_conn contentlength</b></p>
<p><a name="199394">
</a><b>ns_conn driver</b></p>
<p><a name="133310">
</a><b>ns_conn form</b></p>
<p><a name="133302">
</a><b>ns_conn headers</b></p>
<p><a name="133290">
</a><b>ns_conn host</b></p>
<p><a name="217004">
</a><b>ns_conn isconnected</b></p>
<p><a name="133322">
</a><b>ns_conn location</b></p>
<p><a name="3220">
</a><b>ns_conn method</b></p>
<p><a name="133318">
</a><b>ns_conn outputheaders</b> </p>
<p><a name="133306">
</a><b>ns_conn peeraddr</b></p>
<p><a name="133294">
</a><b>ns_conn port</b></p>
<p><a name="133286">
</a><b>ns_conn protocol</b></p>
<p><a name="133298">
</a><b>ns_conn query</b></p>
<p><a name="3224">
</a><b>ns_conn request</b></p>
<p><a name="3228">
</a><b>ns_conn url</b></p>
<p><a name="3244">
</a><b>ns_conn urlc</b></p>
<p><a name="3248">
</a><b>ns_conn urlv</b></p>
<p><a name="3256">
</a><b>ns_conn version</b></p>
<a name="3298">
</a><h4>Description</h4>
<p><a name="3354">
</a><b>ns_conn authpassword</b> returns the decoded user password from the authorization data.</p>
<p><a name="133382">
</a><b>ns_conn authuser</b> returns the decoded user name from the authorization data.</p>
<p><a name="198840">
</a><b>ns_conn close</b> closes the connection so the script (or ADP) can do any time-consuming processing without making the client wait.  If you use <b>ns_conn close</b> in an ADP, streaming should be turned on before closing the connection (i.e. &lt;script runat=server stream=on&gt;) or nothing will get sent out at all!</p>
<p><a name="3376">
</a><b>ns_conn contentlength</b> returns the number of bytes in the content passed in.</p>
<p><a name="199397">
</a><b>ns_conn driver</b> returns the name of the module (nssock or nsssl) that is acting as the communications driver for this connection.</p>
<p><a name="133378">
</a><b>ns_conn form</b> returns any submitted form data as an ns_set.  This form data may have been submitted with a POST or appended to the URL in a GET request.</p>
<p><a name="133374">
</a><b>ns_conn headers</b> returns any header data as an ns_set where the keys are the field names.  The case of the returned field names depends on the HeaderCase configuration parameter.  By default, HeaderCase is "Preserve", which means case is preserved.</p>
<p><a name="133370">
</a><b>ns_conn host</b> returns the host part of the URL in the HTTP request.</p>
<p><a name="217005">
</a><b>ns_conn isconnected</b> returns 1 if you're in a connection thread, and you are therefore allowed to make calls to <b>ns_conn</b>. It returns 0 if you're not in a connection thread (such as when you're in a schedule procedure) and you are not allowed to make calls to <b>ns_conn</b>.</p>
<p><a name="23766">
</a><b>ns_conn location</b> returns the location string for this virtual server in the form <code>protocol://hostname[:port]</code>.</p>
<p><a name="133366">
</a><b>ns_conn method</b> returns the HTTP method.</p>
<p><a name="163531">
</a><b>ns_conn outputheaders</b> returns the set of headers that will be sent out when a result is returned to the client. You can also use this command to write to the set of output headers. For example: </p>
<pre>    <a name="163535"></a>ns_set put [ns_conn outputheaders] <i>key</i> <i>value
</i></pre><p><p><a name="133358">
</a><b>ns_conn peeraddr</b> returns the IP address of the other side of the HTTP connection. The IP address is returned in the form of a string separated with periods (e.g., 155.164.59.75).</p>
<p><a name="133354">
</a><b>ns_conn port</b> returns the port specified explicitly in the URL of the HTTP request. If the browser does not explicity send the ":port" part of the URL, the port number returned will be 0.</p>
<p><a name="133350">
</a><b>ns_conn protocol</b> returns the protocol of the URL in the HTTP request (usually unspecified)</p>
<p><a name="133346">
</a><b>ns_conn query</b> returns any query data that was part of the HTTP request.</p>
<p><a name="133342">
</a><b>ns_conn request</b> returns the HTTP request line.</p>
<p><a name="133338">
</a><b>ns_conn url</b> returns the URL of the HTTP request.</p>
<p><a name="133333">
</a><b>ns_conn urlc</b> returns the number of elements (delimited by `/') in the URL of the HTTP request.</p>
<p><a name="133334">
</a><b>ns_conn urlv</b> returns a list containing the pieces of the URL delimited by `/'.</p>
<p><a name="133327">
</a><b>ns_conn version</b> returns the version of the HTTP request. This is usually 0.9 or 1.0.</p>


<TABLE BORDER="2" CELLPADDING="1" width="100%">
<TR><TD COLSPAN=3><P ALIGN=Center>
<IMG SRC="bluebult.gif">
<A HREF="#topofpage">
<FONT SIZE=-1>Top of Page</FONT></A>
<IMG SRC="bluebult.gif">
</TD></TR>
<TR><TD COLSPAN=3><P ALIGN=Center>
<A href="tapi-c35.htm">
<IMG  BORDER="0" src=navbprev.gif alt="[ Previous ]"></A>
<A href=toc.htm>
<IMG  BORDER="0" src=navbhome.gif alt="[ Contents ]"></A>
<A href=master.htm>
<IMG  BORDER="0" src=navbhelp.gif alt="[ Index ]"></A>
<A href="tapi-c37.htm">
<IMG  BORDER="0" src=navbnext.gif alt="[ Next ]"></A>
<BR align=center>
<FONT size=-1>Copyright &copy; 1998-99 America Online,
Inc.</FONT>
</TD></TR></TABLE></BODY></HTML>