Hi,
I can connect to a ssl server and do i/o. I am trying to move this into a loop using select for active connections. But ssl does not have a fileno and I cannot figure out how to get the parents fileno?
Here is my code:
def start_https():
global in_sock_list
global in_sock_dict
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host_name, tcp_port))
ssl_sock = socket.ssl(s)
ssl_sock.write(“”"GET /index.html HTTP/1.0
“”")
inp,outp,exc = select.select([ssl_sock],[],[],2)
print “got something”
And when I run it via a ssh shell (on a connectportx2) I get:
Traceback (most recent call last):
File “192.168.3.167:ap.py”, line 174, in ?
File “192.168.3.167:ap.py”, line 136, in start_https
TypeError: argument must be an int, or have a fileno() method.
As I understand it ssl is a wrapper around a socket. A blocking read on ssl_sock works fine, instead of the select call. How do I get it’s fileno attribute?
Thanks.