|
27 | 27 |
|
28 | 28 | # Internal constants |
29 | 29 |
|
30 | | -_BUFSIZE = 4096 # Size of TCP/UDP input buffer |
| 30 | +_BUFSIZE = 15*1024 # Size of TCP/UDP input buffer |
31 | 31 |
|
32 | 32 | _myaddress = None |
33 | 33 | _myname = None |
@@ -74,21 +74,21 @@ def _gethostaddress(): |
74 | 74 |
|
75 | 75 | def socket(family, type, *which): |
76 | 76 | if family <> AF_INET: |
77 | | - raise my_error, 'Protocol family %d not supported' % type |
| 77 | + raise _myerror, 'Protocol family %d not supported' % type |
78 | 78 | if type == SOCK_DGRAM: |
79 | 79 | return _udpsocket() |
80 | 80 | elif type == SOCK_STREAM: |
81 | 81 | return _tcpsocket() |
82 | | - raise my_error, 'Protocol type %d not supported' % type |
| 82 | + raise _myerror, 'Protocol type %d not supported' % type |
83 | 83 |
|
84 | 84 |
|
85 | 85 | def fromfd(*args): |
86 | | - raise my_error, 'Operation not supported on a mac' |
| 86 | + raise _myerror, 'Operation not supported on a mac' |
87 | 87 |
|
88 | 88 |
|
89 | 89 | class _socket: |
90 | 90 | def unsupported(self, *args): |
91 | | - raise my_error, 'Operation not supported on this socket' |
| 91 | + raise _myerror, 'Operation not supported on this socket' |
92 | 92 |
|
93 | 93 | accept = unsupported |
94 | 94 | bind = unsupported |
@@ -121,7 +121,7 @@ def __init__(self): |
121 | 121 |
|
122 | 122 | def accept(self): |
123 | 123 | if not self.listening: |
124 | | - raise my_error, 'Not listening' |
| 124 | + raise _myerror, 'Not listening' |
125 | 125 | self.listening = 0 |
126 | 126 | self.stream.wait() |
127 | 127 | self.accepted = 1 |
@@ -169,7 +169,7 @@ def makefile(self, rw = 'r'): |
169 | 169 |
|
170 | 170 | def recv(self, bufsize, flags=0): |
171 | 171 | if flags: |
172 | | - raise my_error, 'recv flags not yet supported on mac' |
| 172 | + raise _myerror, 'recv flags not yet supported on mac' |
173 | 173 | if not self.databuf: |
174 | 174 | try: |
175 | 175 | self.databuf, urg, mark = self.stream.Rcv(0) |
@@ -207,7 +207,7 @@ def __init__(self): |
207 | 207 | class _socketfile: |
208 | 208 |
|
209 | 209 | def __init__(self, sock, rw): |
210 | | - if rw not in ('r', 'w'): raise ValueError, "mode must be 'r' or 'w'" |
| 210 | + if rw not in ('r', 'w'): raise _myerror, "mode must be 'r' or 'w'" |
211 | 211 | self.sock = sock |
212 | 212 | self.rw = rw |
213 | 213 | self.buf = '' |
|
0 commit comments