63 lines
1.4 KiB
HTML
63 lines
1.4 KiB
HTML
<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 />
|
|
Print ReadLine$( tcp )
|
|
<br />
|
|
Wend
|
|
<br />
|
|
|
|
<br />
|
|
If Eof(tcp)=1 Then Print "Success!" Else Print "Error!"
|
|
<br />
|
|
|
|
<br />
|
|
CloseTCPStream tcp
|
|
<br />
|
|
|
|
<br />
|
|
WaitKey
|
|
<br />
|
|
End
|
|
<br />
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=CloseTCPStream&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|