LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-25-2009, 08:57 AM   #1
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 50
python: socket with makefile


Hi,

I am trying to make a simple proxy server in python and I am just learning how to use makefile and readlines/writelines.

I simple open up a socket and starts to listen to a port. The browser is then configured to use this port as proxy server. The server calls accept() on the socket and I then create a file-object using socket.makefile().

Now, I am trying to read the data using readlines() on the file object but it just hangs there, never completes.

Also I am not really sure how to use this makefile. Is it true that I can create a fileobject and then both read from it and write to it, using readlines() and writelines() respectively (on the same file object)?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Python: work while waiting for socket connection? hbar Programming 4 10-27-2010 04:57 AM
Is it mandatory to have the name of the makefile as 'Makefile' for kernal module comp narender.d Linux - Kernel 3 05-29-2009 06:26 AM
Python socket: does not recieve anything Hewson Programming 4 03-28-2008 12:53 PM
python: full string isn't making it through socket cs-cam Programming 1 11-26-2005 11:20 PM
socket programming on-line books in python or in C pranith Programming 2 11-20-2004 10:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration