Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
iso8583
/
iso8583-web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5d543ae1
authored
Apr 20, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
inherite on loop on Request Handler and CLient
1 parent
0754a173
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
5 deletions
iso8583_web/scripts/forwarder.py
iso8583_web/scripts/forwarder.py
View file @
5d543ae
...
@@ -176,13 +176,16 @@ class RequestHandler(BaseRequestHandler, CommonConnection):
...
@@ -176,13 +176,16 @@ class RequestHandler(BaseRequestHandler, CommonConnection):
if
self
.
is_timeout
():
if
self
.
is_timeout
():
self
.
close_because_timeout
()
self
.
close_because_timeout
()
return
return
# i = 0
# raw = self.streamer.get(raw)
# if not raw:
# return
# raw = self.process(raw)
# if raw:
# self.send(raw)
while
True
:
while
True
:
raw
=
self
.
streamer
.
get
(
raw
)
raw
=
self
.
streamer
.
get
(
raw
)
# i += 1
# self.log_info(">> RAW {}, {}".format(i, raw))
# self.log_info(">> SISA {}, {}".format(i, self.streamer.raw))
if
not
raw
:
if
not
raw
:
break
break
raw
=
self
.
process
(
raw
)
raw
=
self
.
process
(
raw
)
...
@@ -294,6 +297,32 @@ class Client(BaseClient, CommonConnection):
...
@@ -294,6 +297,32 @@ class Client(BaseClient, CommonConnection):
except
:
except
:
self
.
log_unknown
()
self
.
log_unknown
()
def
on_loop
(
self
):
raw
=
self
.
receive_raw
()
if
not
raw
:
if
self
.
is_timeout
():
if
not
self
.
conf
[
'listen'
]:
self
.
set_connected_time
()
return
self
.
close_because_timeout
()
return
# raw = self.streamer.get(raw)
# if not raw:
# return
# raw = self.process(raw)
# if raw:
# self.send(raw)
while
True
:
raw
=
self
.
streamer
.
get
(
raw
)
if
not
raw
:
break
raw
=
self
.
process
(
raw
)
if
raw
:
self
.
send
(
raw
)
raw
=
''
def
start_client
(
conf
):
def
start_client
(
conf
):
client
=
Client
(
conf
)
client
=
Client
(
conf
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment