fixes #38. send() and sendall() seem to be good now (i think).
This commit is contained in:
@@ -282,11 +282,6 @@ class GreenSocket(object):
|
|||||||
if self.act_non_blocking:
|
if self.act_non_blocking:
|
||||||
return fd.send(data, flags)
|
return fd.send(data, flags)
|
||||||
|
|
||||||
# XXX: need to deal with the exceptions that could be raised if the
|
|
||||||
# buffer is full (specifically the try/except below)
|
|
||||||
|
|
||||||
# need to test all of the conditions
|
|
||||||
|
|
||||||
# blocking socket behavior - sends all, blocks if the buffer is full
|
# blocking socket behavior - sends all, blocks if the buffer is full
|
||||||
total_sent = 0
|
total_sent = 0
|
||||||
len_data = len(data)
|
len_data = len(data)
|
||||||
|
@@ -160,7 +160,6 @@ class TestGreenIo(LimitedTestCase):
|
|||||||
def server():
|
def server():
|
||||||
# accept the connection in another greenlet
|
# accept the connection in another greenlet
|
||||||
sock, addr = listener.accept()
|
sock, addr = listener.accept()
|
||||||
bufsized(sock, 1)
|
|
||||||
|
|
||||||
eventlet.sleep(.5)
|
eventlet.sleep(.5)
|
||||||
|
|
||||||
@@ -172,14 +171,14 @@ class TestGreenIo(LimitedTestCase):
|
|||||||
client.settimeout(0.1)
|
client.settimeout(0.1)
|
||||||
|
|
||||||
client.connect(addr)
|
client.connect(addr)
|
||||||
bufsized(client, 1)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
msg = "A"*min_buf_size()
|
msg = "A"*8192*1024
|
||||||
|
|
||||||
|
total_sent = 0
|
||||||
# want to exceed the size of the OS buffer so it'll block
|
# want to exceed the size of the OS buffer so it'll block
|
||||||
for x in range(10):
|
for x in range(10):
|
||||||
client.send(msg)
|
total_sent += client.send(msg)
|
||||||
self.fail("socket.timeout not raised")
|
self.fail("socket.timeout not raised")
|
||||||
except socket.timeout, e:
|
except socket.timeout, e:
|
||||||
self.assert_(hasattr(e, 'args'))
|
self.assert_(hasattr(e, 'args'))
|
||||||
|
Reference in New Issue
Block a user