Migrated from tutorial-sockets v5

This commit is contained in:
Araq 2010-09-14 03:11:08 -07:00
parent 2938610992
commit f474ca356c
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ Then you need to create and initialize a TSocket object<br>
After that you can use <code>s.connect("addr", TPort(80))</code> to connect to a server<br>
Once you connect to a server, you can send and receive messages to/from the server by using <code>s.send("Message")</code> to send, and <code>s.recv()</code> to receive.
<pre><nowiki>
<pre>
import sockets, strutils
when not defined(strutils.toStringSep):
@ -68,4 +68,4 @@ while True:
elif data.split()[3] == ":!totalmem":
var msg = "Total memory: " & formatSize(int64(getTotalMem()))
s.send("PRIVMSG " & data.split()[2] & " :" & msg & "\c\L")
</nowiki></pre>
</pre>