2014-12-08 12:43:20 +13:00
|
|
|
<html>
|
|
|
|
|
<head>
|
|
|
|
|
<title>Blitz3D Docs</title>
|
|
|
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<h1>CloseTCPStream streamhandle</h1>
|
|
|
|
|
<h1>Parameters</h1>
|
|
|
|
|
<table>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
streamhandle = handle assigned when the stream was opened.
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<h1>Description</h1>
|
|
|
|
|
<table>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
Once you've completed the use of your TCP/IP stream, close the connection you opened with OpenTCPStream with this command.
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<h1><a href=../2d_examples/CloseTCPStream.bb>Example</a></h1>
|
|
|
|
|
<table>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
; OpenTCPStream/CloseTCPStream Example
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
Print "Connecting..."
|
|
|
|
|
<br />
|
|
|
|
|
tcp=OpenTCPStream( "www.blitzbasement.com",80 )
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
If Not tcp Print "Failed.":WaitKey:End
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
Print "Connected! Sending request..."
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
WriteLine tcp,"GET http://www.blitzbasement.com HTTP/1.0"
|
|
|
|
|
<br />
|
|
|
|
|
WriteLine tcp,Chr$(10)
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
If Eof(tcp) Print "Failed.":WaitKey:End
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
Print "Request sent! Waiting for reply..."
|
|
|
|
|
<br />
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
|
While Not Eof(tcp)
|
|
|
|
|
<br />
|
2014-02-26 16:08:39 +13:00
|
|
|
Print ReadLine$( tcp )
|