Commit 5f39412c authored by zolliker's avatar zolliker
Browse files

Merge branch 'master' of gitlab.psi.ch:zolliker/aputools

Conflicts:
	install.py
parents 2fadf63d a9c1c38d
......@@ -12,7 +12,7 @@ from ipaddress import IPv4Interface
from configparser import ConfigParser
from os.path import join, getmtime, exists
os.chdir('to_system')
os.chdir('/root/aputools/to_system')
DEL = '__to_delete__'
CFGPATH = '/root/aputools/servercfg/%s.cfg'
......
import sys
import socket
from select import select
from serial import serial_for_url
......@@ -98,7 +99,7 @@ class AcceptHandler:
:param: port offered port for routing
:param: addr where to route
:param: iocls the io ahndler class, currently TcpHandler or SerialHandler
:param: iocls the io handler class, currently TcpHandler or SerialHandler
:param: maxcount the maximal number of concurrent connections. defauls to 1
as a side effect, if the destination is a web server, the traffic
are serialized (only one connection at a time), which helps for
......@@ -140,8 +141,13 @@ class AcceptHandler:
if not self.available:
self.pending += 1
return
client, addr = self.socket.accept()
handler = self.iocls(client, self)
try:
client, addr = self.socket.accept()
handler = self.iocls(client, self)
except Exception as e:
print('ERROR creating %s(%r)' % (self.iocls.__name__, self.addr))
client.close()
return
self.readers[client.fileno()] = handler.request
self.readers[handler.fno] = handler.reply
self.available -= 1
......
[NETWORK]
address=00:0d:b9:59:1f:ac
enp1s0=dhcp
enp2s0=192.168.127.2/24
enp3s0=192.168.2.3/24
enp4s0=192.168.2.4/24
enp2s0=192.168.2.1/24
enp3s0=192.168.3.1/24
enp4s0=192.168.127.1/24
[ROUTER]
3000=/dev/ttyUSB0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment