Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
Taxi App Development 7.3
RentALL-Airbnb clone script 1.8.0
VisualNEO Web 19.4.5
PHP Ecommerce Script 1.3.2
dbForge Studio for PostgreSQL 2.1
Rentonn - Airbnb clone 1.0
VisualNEO for Windows 18.08.31.0
SentiVeillance SDK Trial 7.0.191272
dbForge SQL Complete 6.1
Uber for E-Scooters 1.0
ODBC Driver for MySQL 2.4
dbForge Schema Compare for MySQL 4.4
dbForge Studio for MySQL 8.1
dbForge Query Builder for MySQL 4.4
dbForge Data Compare for MySQL 5.5
Top Code
JChartLib 1.0
MLM Software ONE 1.5.46
Taxi App Development 7.3
Java-2-Pseudo 1.0
PHP Source Code Utility 1.0.0
Nonlinear F-16 Fighter Model 1.0
MCU 8051 IDE 1.4.7
iScripts NetMenus 2.0
Paypal Clone Script 1.0.9
Football manager 1.0
Betting system 6.x-1.x-dev
Efficient Conjugate Gradient Method for Symmetric Banded Matrix 1.0
Video Conference Website Scripts 2.86
Car Rental Script 2.0
Sugeno-Takagi-like fuzzy controller 1.0
Top Rated
Paste phpSoftPro 1.4.1
Deals and Discounts Website Script 1.0.2
ADO.NET Provider for ExactTarget 1.0
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
Availability Booking Calendar PHP 1.0
PHP GZ Blog Script 1.1
ATN Jobs Software 4.0
ATN Mall 2.0
When to not just use socket.close() 
File ID: 66187






When to not just use socket.close() 
Download When to not just use socket.close() http://code.activestate.com/recipes/496941-simple-readlines-in-reverse-wdeque/?in=lang-pythonReport Error Link
License: Freeware
Downloads: 5
Submit Rating:
When to not just use socket.close()  Description
Description: I have implemented a "broken" client/server to show how socket.shutdown can be more useful than a simple socket.close operation. (I rewrote this to hopefully be more clear)

The close operation is not atomic. It implicitly tries to send any remaining data in _addition_ to closing a descriptor. Splitting this close operation up with the aid of the shutdown command can help avoid bugs. It gives the server one final way to say, "something went wrong". The server would also know that the client did not end correctly, since the socket should remain open when the client finished sending data. For example, if the function exits unexpectedly and python closes the socket for you, the server would not be able to send any data back.

In the server below, the client and server have different ideas about what the end marker should be. The rev_end function is written so as to look for an end marker. And, as long as they agree it should work. The socket.shutdown is for when something goes wrong.

License: Freeware

Related: Network

O/S:Windows

Downloads: 5



More Similar Code

This recipe combines the delicious PageTemplates package with the flavorful Medusa package to serve up rendered PageTemplates from the file system.

Why not just use Zope you say? As far as I know, the current Zope release isn't an option with Python 2.2 code. The project for which this recipe was devised requires Python 2.2.

Ingredients you'll need:


Python 2.2. If you're using 2.1, try Zope instead, as...



NJAMD (Not Just Another Malloc Debugger) protects against all common dynamic memory bugs, without even relinking your executable. It also provides stack trace information, and eventually will include a full GUI interface. NJAMD NEEDS YOUR HELP!



CVBars are volume dependent as opposed to time dependent candlesticks; the close of the candle occurs when some volume criteria is met, not some variable timescale (1m, 5m, etc.)

This is my first attempt to code and would be grateful...



PHP-Utils is a set of classes to make it easier to build all sorts of applications, not just web-applications. One of the purposes is to make it really easy to use and equally as easy to extend with your own classes.All classes are written in PHP...



To illustrate the use case, if you have three languages enabled for content translation on your Drupal website, French, German and English, and French is the default language, when you create a new node in French, this module will automatically...



The Node Menu Parent module extends the "default menu for content" setting provided by the core menu module by allowing a specific menu item to be selected (not just a top-level menu) per content type.
Example

Imagine...



This Sourcforge project is NOT IN USE yet! It has just been created in order to explore the Sourceforge platform for a possible future use by EJS. EJS is developed and by Francisco Esquembre, University of Murcia, Spain.



With legendflex, you can:

- position the legend relative to any object in any figure, not just the parent axis of whatever is being labeled

- organize legend text and symbols in a grid with a specified number of rows and/or...



This is not just another video embed tool - it includes every functionality you might need for video and rich-media, including the ability to upload/ record/import videos directly to your post, edit and remix content with an online video editor,...



The idea behind the Bible Field module is to provide a CCK field that can reference any body of work (not just Bibles) by book, chapter and verse. Below are some features:

* The ability to reference a range or single point
* A...

User Review for When to not just use socket.close()
- required fields
     

Please enter text on the image