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
Deal Or No Deal Game Icon
A game based on the tv game show, Deal Or No Deal.
Free
Disk Dumper Icon
This recipe will display a hex dump of the disk specified on the command line.
Complex Boolean Regular Expression Class Icon
Need to look for the occurence of words in a string or group of words
Free
Display an Image from a specified file Icon
Reads an image file from the filename specified as the 1st parameter
Free
Quickslice decorator Icon
Quickslice decorator script defines a decorator that allows for an abbreviated
Free
mx.ODBC example Icon
mx.ODBC example script shows you how to get the columns of a table and get data.
Free
Python replacement for java.util.Properties Icon
Quick and easy way to process Java properties files using pure Python
Free
More