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 0754a173
authored
Apr 20, 2019
by
Solo Group
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
inherite on loop
1 parent
d736e92b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
iso8583_web/scripts/forwarder.py
iso8583_web/scripts/forwarder.py
View file @
0754a17
...
@@ -129,7 +129,6 @@ class CommonConnection(Log):
...
@@ -129,7 +129,6 @@ class CommonConnection(Log):
self
.
log_info
(
'ISO8583 to raw {}'
.
format
([
raw
]))
self
.
log_info
(
'ISO8583 to raw {}'
.
format
([
raw
]))
def
process
(
self
,
raw
):
def
process
(
self
,
raw
):
self
.
log_info
(
'PROSES THREAD'
)
parser
=
Parser
(
self
,
raw
)
parser
=
Parser
(
self
,
raw
)
thread
=
create_thread
(
parser
.
run
)
thread
=
create_thread
(
parser
.
run
)
parser_threads
.
append
((
parser
,
thread
))
parser_threads
.
append
((
parser
,
thread
))
...
@@ -165,10 +164,32 @@ class RequestHandler(BaseRequestHandler, CommonConnection):
...
@@ -165,10 +164,32 @@ class RequestHandler(BaseRequestHandler, CommonConnection):
self
.
running
=
False
self
.
running
=
False
conn_mgr
.
add
(
self
)
conn_mgr
.
add
(
self
)
BaseRequestHandler
.
handle
(
self
)
BaseRequestHandler
.
handle
(
self
)
# ini ditambahkan
def
is_loop
(
self
):
def
is_loop
(
self
):
sleep
(
0.1
)
sleep
(
0.1
)
return
self
.
running
return
self
.
running
def
on_loop
(
self
):
raw
=
self
.
receive_raw
()
if
not
raw
:
if
self
.
is_timeout
():
self
.
close_because_timeout
()
return
# i = 0
while
True
:
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
:
break
raw
=
self
.
process
(
raw
)
if
raw
:
self
.
send
(
raw
)
raw
=
''
def
on_receive_raw
(
self
,
raw
):
def
on_receive_raw
(
self
,
raw
):
self
.
log_receive_raw
(
raw
)
self
.
log_receive_raw
(
raw
)
BaseRequestHandler
.
on_receive_raw
(
self
,
raw
)
BaseRequestHandler
.
on_receive_raw
(
self
,
raw
)
...
...
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