socket.recv Icon

socket.recv

An issue with socket.recv is how to know when you are done receiving data.

socket.recvOverview

Editor: An issue with socket.recv is how to know when you are done receiving data. A TCP stream guarantees the bytes will not arrive out of order or be sent more than once. But you do not know the size of the data that will be sent to you. 100 bytes could be sent as group of 10 bytes or maybe in one shot. Ultimately, this means you have to use a loop in some fashion until you know it is done.

The basic recv returns an empty String when the socket is disconnected. From that you can build a simple loop that will work as long as the Sender manages to disconnect the socket at the appropriate time. However, there could be situations where a local error will mask as a clean shutdown or maybe a close() is never called.

NEW

Fixed some bugs.

socket.recvInformation

Version
1.4
Date
03.19.10
License
Free
Language
English
File Size
N/A
Developer
Category
SubCategory
Operating Systems
Linux,BSD
System Requirements
No additional system requirements.
mx.ODBC example Icon
mx.ODBC example script shows you how to get the columns of a table and get data.
Free
Metakit for safe reading and writing Icon
Metakit is a reliable/lightweight/fast database library that python can use.
Free
simplest useful HTTPS with basic proxy authentication Icon
This is just about the most simple snippet of how to do proxy authentication
Changing file attributes on windows Icon
Offers SetFileAttributes whiles allows you to make changes to a file in windows
Large File Sizes on 32 bit Windows Icon
Large File Sizes on 32 bit Windows script uses the FindFiles win32call.
Accessing MS exchange with webdav Icon
Accessing MS exchange with webdav script allows you to query an MS exchange.
Converting windows 64 bit time Icon
Converting windows 64 bit time script is a function that returns the time
Simplest HTTPS with basic proxy authentication Icon
Simple snippet of how to do proxy authentication with SSL using python
More
Principal Component Analysis (PCA) Icon
A class that carries out Principal Component Analysis (PCA).
Free
CRC64 Icon
The algorithm to compute the CRC is described in the ISO 3309 standard
Mini Fake DNS server Icon
Minimal python dns server, it only replies with a selected ip in an A record
Stripchart Plotter Icon
OpenGL Stripchart plotter for a user defined number of channels.
Free
Metakit for safe reading and writing Icon
Metakit is a reliable/lightweight/fast database library that python can use.
Free
Album Track List Generator Icon
Album Track List Generator allows you to extract artist, album title and track t
Free
SRCDS Icon
A library to interface with Half-Life2 Dedicated Servers
Free
Mod_python Icon
Apache module that embeds the Python interpreter within the server.
More