Raise Error Ebadf Bad File
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about socket.error errno 9 bad file descriptor python Stack Overflow the company Business Learn more about hiring developers or posting ads with
Python Bad File Descriptor
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Python Socket Close
a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Python socket (Socket Error Bad File Descriptor) up vote 9 down vote favorite The
Ioerror: [errno 9] Bad File Descriptor
following receiveFile() function reads a filename and file data from the socket and splits it using the delimiter $. But I am unable to close the socket and a Bad file descriptor error is raised. If I comment out the self.server_socket.close() statement then there is no error but the socket is listening forever. Code:- def listen(self): self.server_socket.listen(10) while True: client_socket, address = self.server_socket.accept() print 'connected to', address self.receiveFile(client_socket) def receiveFile(self,sock): data python socket select = sock.recv(1024) data = data.split("$"); print 'filename', data[0] f = open(data[0], "wb") #data = sock.recv(1024) print 'the data is', data[1] f.write(data[1]) data = sock.recv(1024) while (data): f.write(data) data=sock.recv(1024) f.close() self.server_socket.close() print 'the data is', data print "File Downloaded" Traceback:- Traceback (most recent call last): File "server.py", line 45, in
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn python socket timeout more about Stack Overflow the company Business Learn more about hiring developers or posting python socket example ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community python open Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up 'socket.error: [Errno 9] Bad file descriptor' as I run my http://stackoverflow.com/questions/16382899/python-socket-socket-error-bad-file-descriptor client up vote 0 down vote favorite as I run my client, my server collapse, it says: Traceback (most recent call last): File "C:/Users/Or/PycharmProjects/2.6/cyber.py", line 17, in
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us http://stackoverflow.com/questions/11491187/socket-receive-in-python Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack https://bugs.python.org/issue13344 Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Socket.receive in python up vote 0 down bad file vote favorite I made a simple TCP fuzzer in Python. I need it to be able to receive some response and if I didn't get the response, break the loop. My code is this: import socket from time import sleep import sys ip = raw_input ("please insert host ip: ") port = input ("please insert port to fuzz: ") packet = raw_input ("what string would you like bad file descriptor to fuzz with? : ") multi = input ("in what jumps would you liike to multiply the string ? (10 = A*10) : ") host = ip, port s = socket.socket() char = packet * multi a = 1 try: while a > 0: s.connect((host)) s.send(packet) sleep(1) print 'fuzzing param %s' % (packet) packet = char + packet s.close() except (Exception): print "Connection lost for some reason"' But when I run the program I get this error: please insert host ip: 10.0.0.138 please insert port to fuzz: 80 what string would you like to fuzz with? : A in what jumps would you liike to multiply the string ? (10 = A*10) : 2 fuzzing param A Connection lost which is weird because it just suppose to reconnect in an endless loop , (i know the server didn't crush) python sockets fuzzing share|improve this question edited Jul 15 '12 at 12:01 asked Jul 15 '12 at 10:32 Ba7a7chy 3603420 I would highly recommend you to try Peach: peachfuzzer.com –zenpoy Jul 15 '12 at 10:34 i wouldn't really use it professionally i got better fuzzer's but its more of a python programming exercise for me –B
User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue13344 classification Title: closed sockets don't raise EBADF anymore Type: behavior Stage: Components: Library (Lib) Versions: Python 3.2, Python 3.3 process Status: open Resolution: Dependencies: Superseder: Assigned To: Nosy List: colinmarc, exarkun, giampaolo.rodola, martin.panter, pconnell, pitrou Priority: low Keywords: Created on 2011-11-04 21:14 by pitrou, last changed 2016-06-24 02:20 by martin.panter. Messages (3) msg147039 - (view) Author: Antoine Pitrou (pitrou) * Date: 2011-11-04 21:14 This decrepancy between 2.x and 3.x is witnessed under Windows: Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> sock = socket.create_connection(("www.python.org", 80)) >>> sock.close() >>> sock.send(b"x") Traceback (most recent call last): File "