Changeset 162
- Timestamp:
- 06/16/12 20:00:37 (12 years ago)
- Location:
- etherws/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
etherws/trunk/README.rst
r160 r162 46 46 # ifconfig br0 up 47 47 48 If connection through the tunnel is unstable, then you may fix it 49 by changing VM's MTU to under 1500, e.g.:: 48 Additionally, you may improve performance by increasing MTU. 49 For example, 50 50 51 # ifconfig eth0 mtu 1400 51 on each hypervisor:: 52 53 # ifconfig vnet0 mtu 16436 54 # ifconfig ethws0 mtu 16436 55 56 on each VM:: 57 58 # ifconfig eth0 mtu 16436 52 59 53 60 Using SSL/TLS … … 124 131 History 125 132 ======= 133 0.6 (2012-06-16 JST) 134 - improve performance 135 126 136 0.5 (2012-05-20 JST) 127 137 - added passwd option to client mode -
etherws/trunk/etherws.py
r160 r162 67 67 68 68 class TapHandler(DebugMixIn): 69 READ_SIZE = 65535 70 69 71 def __init__(self, dev, debug=False): 70 72 self._debug = debug … … 72 74 self._tap = pytun.TunTapDevice(dev, pytun.IFF_TAP | pytun.IFF_NO_PI) 73 75 self._tap.up() 74 self._ glock = threading.Lock()76 self._taplock = threading.Lock() 75 77 76 78 def fileno(self): 77 with self._ glock:79 with self._taplock: 78 80 return self._tap.fileno() 79 81 80 82 def register_client(self, client): 81 with self._glock: 82 self._clients.append(client) 83 self._clients.append(client) 83 84 84 85 def unregister_client(self, client): 85 with self._glock: 86 self._clients.remove(client) 86 self._clients.remove(client) 87 87 88 88 def write(self, caller, message): 89 with self._glock: 90 clients = self._clients[:] 91 92 if caller is not self: 93 clients.remove(caller) 89 clients = self._clients[:] 90 91 if caller is not self: 92 clients.remove(caller) 93 94 with self._taplock: 94 95 self._tap.write(message) 95 96 96 97 97 for c in clients: 98 c.write_message(message, True) 98 99 99 100 def __call__(self, fd, events): 100 with self._glock: 101 data = self._tap.read(self._tap.mtu) 102 self.write(self, data) 101 buf = [] 102 103 while True: 104 with self._taplock: 105 data = self._tap.read(self.READ_SIZE) 106 107 if data: 108 buf.append(data) 109 110 if len(data) < self.READ_SIZE: 111 break 112 113 self.write(self, ''.join(buf)) 103 114 104 115 -
etherws/trunk/setup.py
r160 r162 37 37 setup( 38 38 name='etherws', 39 version='0. 5',39 version='0.6', 40 40 description='Ethernet over WebSocket tunneling server/client', 41 41 long_description=longdesc,
Note: See TracChangeset
for help on using the changeset viewer.