diff options
author | Gregory P. Smith <greg@krypto.org> | 2011-06-05 06:05:19 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2011-06-05 06:05:19 (GMT) |
commit | d64b2bae9b4d1b761cd16f75e3fe3e9c19533b3e (patch) | |
tree | cac5baf3e31b67e39cb9b69d982958cc9419db06 /Doc/howto/sockets.rst | |
parent | b6471db8a76416b2eb49fe9b02c6f9f9a6502b4d (diff) | |
parent | e13e662244b4915e933eb2c84bc50705f99f5c4a (diff) | |
download | cpython-d64b2bae9b4d1b761cd16f75e3fe3e9c19533b3e.zip cpython-d64b2bae9b4d1b761cd16f75e3fe3e9c19533b3e.tar.gz cpython-d64b2bae9b4d1b761cd16f75e3fe3e9c19533b3e.tar.bz2 |
merge heads.
Diffstat (limited to 'Doc/howto/sockets.rst')
-rw-r--r-- | Doc/howto/sockets.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst index 04e9b98..2416807 100644 --- a/Doc/howto/sockets.rst +++ b/Doc/howto/sockets.rst @@ -23,8 +23,8 @@ It's not really a tutorial - you'll still have work to do in getting things working. It doesn't cover the fine points (and there are a lot of them), but I hope it will give you enough background to begin using them decently. -I'm only going to talk about INET sockets, but they account for at least 99% of -the sockets in use. And I'll only talk about STREAM sockets - unless you really +I'm only going to talk about INET (i.e. IPv4) sockets, but they account for at least 99% of +the sockets in use. And I'll only talk about STREAM (i.e. TCP) sockets - unless you really know what you're doing (in which case this HOWTO isn't for you!), you'll get better behavior and performance from a STREAM socket than anything else. I will try to clear up the mystery of what a socket is, as well as some hints on how to @@ -208,10 +208,10 @@ length message:: totalsent = totalsent + sent def myreceive(self): - msg = '' + msg = b'' while len(msg) < MSGLEN: chunk = self.sock.recv(MSGLEN-len(msg)) - if chunk == '': + if chunk == b'': raise RuntimeError("socket connection broken") msg = msg + chunk return msg |