Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
39b9486c
Commit
39b9486c
authored
Jan 10, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
socket: remove redundant argument
parent
b9af63ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
gevent/socket.py
gevent/socket.py
+16
-16
No files found.
gevent/socket.py
View file @
39b9486c
...
...
@@ -246,7 +246,7 @@ class socket(object):
if
res
is
not
None
:
client
,
addr
=
res
return
type
(
self
)(
client
),
addr
wait_read
(
fd
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
fd
.
fileno
(),
timeout
=
self
.
timeout
)
def
close
(
self
):
self
.
fd
=
_closedsocket
()
...
...
@@ -262,7 +262,7 @@ class socket(object):
fd
=
self
.
fd
if
self
.
timeout
is
None
:
while
not
socket_connect
(
fd
,
address
):
wait_write
(
fd
.
fileno
()
,
timeout_exc
=
timeout
)
wait_write
(
fd
.
fileno
())
else
:
end
=
time
.
time
()
+
self
.
timeout
while
True
:
...
...
@@ -270,7 +270,7 @@ class socket(object):
return
if
time
.
time
()
>=
end
:
raise
timeout
wait_write
(
fd
.
fileno
(),
timeout
=
end
-
time
.
time
()
,
timeout_exc
=
timeout
)
wait_write
(
fd
.
fileno
(),
timeout
=
end
-
time
.
time
())
def
connect_ex
(
self
,
address
):
if
self
.
timeout
==
0.0
:
...
...
@@ -279,7 +279,7 @@ class socket(object):
if
self
.
timeout
is
None
:
while
not
socket_connect
(
fd
,
address
):
try
:
wait_write
(
fd
.
fileno
()
,
timeout_exc
=
timeout
)
wait_write
(
fd
.
fileno
())
except
error
,
ex
:
return
ex
[
0
]
else
:
...
...
@@ -290,7 +290,7 @@ class socket(object):
if
time
.
time
()
>=
end
:
raise
timeout
try
:
wait_write
(
fd
.
fileno
(),
timeout
=
end
-
time
.
time
()
,
timeout_exc
=
timeout
)
wait_write
(
fd
.
fileno
(),
timeout
=
end
-
time
.
time
())
except
error
,
ex
:
return
ex
[
0
]
...
...
@@ -305,29 +305,29 @@ class socket(object):
def
recv
(
self
,
*
args
):
if
self
.
timeout
!=
0.0
:
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
)
return
self
.
fd
.
recv
(
*
args
)
def
recvfrom
(
self
,
*
args
):
if
self
.
timeout
!=
0.0
:
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
)
return
self
.
fd
.
recvfrom
(
*
args
)
def
recvfrom_into
(
self
,
*
args
):
if
self
.
timeout
!=
0.0
:
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
)
return
self
.
fd
.
recvfrom_into
(
*
args
)
def
recv_into
(
self
,
*
args
):
if
self
.
timeout
!=
0.0
:
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
)
return
self
.
fd
.
recv_into
(
*
args
)
def
send
(
self
,
data
,
timeout
=
timeout_default
):
if
timeout
is
timeout_default
:
timeout
=
self
.
timeout
if
timeout
!=
0.0
:
wait_write
(
self
.
fileno
(),
timeout
=
timeout
,
timeout_exc
=
_socket
.
timeout
)
wait_write
(
self
.
fileno
(),
timeout
=
timeout
)
return
self
.
fd
.
send
(
data
)
def
sendall
(
self
,
data
):
...
...
@@ -349,7 +349,7 @@ class socket(object):
def
sendto
(
self
,
*
args
):
if
self
.
timeout
!=
0.0
:
wait_write
(
self
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_write
(
self
.
fileno
(),
timeout
=
self
.
timeout
)
return
self
.
fd
.
sendto
(
*
args
)
def
setblocking
(
self
,
flag
):
...
...
@@ -414,7 +414,7 @@ class GreenSSL(socket):
accepted
=
type
(
self
)(
client
,
server_side
=
True
)
accepted
.
do_handshake
()
return
accepted
,
addr
wait_read
(
fd
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
fd
.
fileno
(),
timeout
=
self
.
timeout
)
def
do_handshake
(
self
):
while
True
:
...
...
@@ -444,12 +444,12 @@ class GreenSSL(socket):
if
self
.
timeout
==
0.0
:
raise
timeout
(
str
(
ex
))
else
:
wait_write
(
self
.
fileno
(),
timeout
=
timeout
,
timeout_exc
=
_socket
.
timeout
)
wait_write
(
self
.
fileno
(),
timeout
=
timeout
)
except
SSL
.
WantReadError
,
ex
:
if
self
.
timeout
==
0.0
:
raise
timeout
(
str
(
ex
))
else
:
wait_read
(
self
.
fileno
(),
timeout
=
timeout
,
timeout_exc
=
_socket
.
timeout
)
wait_read
(
self
.
fileno
(),
timeout
=
timeout
)
except
SSL
.
SysCallError
,
e
:
if
e
[
0
]
==
-
1
and
data
==
""
:
# errors when writing empty strings are expected and can be ignored
...
...
@@ -469,12 +469,12 @@ class GreenSSL(socket):
if
self
.
timeout
==
0.0
:
raise
timeout
(
str
(
ex
))
else
:
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
)
except
SSL
.
WantWriteError
,
ex
:
if
self
.
timeout
==
0.0
:
raise
timeout
(
str
(
ex
))
else
:
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
,
timeout_exc
=
timeout
)
wait_read
(
self
.
fileno
(),
timeout
=
self
.
timeout
)
except
SSL
.
ZeroReturnError
:
return
''
except
SSL
.
SysCallError
,
ex
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment