Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
6d13bbc0
Commit
6d13bbc0
authored
Jul 23, 2019
by
Andrea Amantini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow sockets to bind to configured ip string in kernel profile
instead of hardcoded localhost (127.0.0.1)
parent
50116ade
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
ZeroMQ.hs
ipython-kernel/src/IHaskell/IPython/ZeroMQ.hs
+8
-8
No files found.
ipython-kernel/src/IHaskell/IPython/ZeroMQ.hs
View file @
6d13bbc0
...
...
@@ -92,14 +92,14 @@ serveProfile profile debug = do
-- complete, the context or socket become invalid.
_
<-
forkIO
$
withContext
$
\
ctxt
->
do
-- Serve on all sockets.
_
<-
forkIO
$
serveSocket
ctxt
Rep
(
hbPort
profile
)
$
heartbeat
channels
_
<-
forkIO
$
serveSocket
ctxt
Router
(
controlPort
profile
)
$
control
debug
channels
_
<-
forkIO
$
serveSocket
ctxt
Router
(
shellPort
profile
)
$
shell
debug
channels
_
<-
forkIO
$
serveSocket
ctxt
Rep
(
ip
profile
)
(
hbPort
profile
)
$
heartbeat
channels
_
<-
forkIO
$
serveSocket
ctxt
Router
(
ip
profile
)
(
controlPort
profile
)
$
control
debug
channels
_
<-
forkIO
$
serveSocket
ctxt
Router
(
ip
profile
)
(
shellPort
profile
)
$
shell
debug
channels
-- The ctxt is reference counted in this thread only. Thus, the last serveSocket cannot be
-- asynchronous, because otherwise ctxt would be garbage collectable - since it would only be
-- used in other threads. Thus, keep the last serveSocket in this thread.
serveSocket
ctxt
Pub
(
iopubPort
profile
)
$
iopub
debug
channels
serveSocket
ctxt
Pub
(
i
p
profile
)
(
i
opubPort
profile
)
$
iopub
debug
channels
return
channels
...
...
@@ -182,7 +182,7 @@ serveStdin profile = do
-- complete, the context or socket become invalid.
_
<-
forkIO
$
withContext
$
\
ctxt
->
-- Serve on all sockets.
serveSocket
ctxt
Router
(
stdinPort
profile
)
$
\
sock
->
do
serveSocket
ctxt
Router
(
ip
profile
)
(
stdinPort
profile
)
$
\
sock
->
do
-- Read the request from the interface channel and send it.
readChan
reqChannel
>>=
sendMessage
False
(
signatureKey
profile
)
sock
...
...
@@ -193,10 +193,10 @@ serveStdin profile = do
-- | Serve on a given sock in a separate thread. Bind the sock in the | given context and then
-- loop the provided action, which should listen | on the sock and respond to any events.
serveSocket
::
SocketType
a
=>
Context
->
a
->
Port
->
(
Socket
a
->
IO
b
)
->
IO
()
serveSocket
ctxt
socketType
port
action
=
void
$
serveSocket
::
SocketType
a
=>
Context
->
a
->
IP
->
Port
->
(
Socket
a
->
IO
b
)
->
IO
()
serveSocket
ctxt
socketType
ip
port
action
=
void
$
withSocket
ctxt
socketType
$
\
sock
->
do
bind
sock
$
"tcp://
127.0.0.1
:"
++
show
port
bind
sock
$
"tcp://
"
++
ip
++
"
:"
++
show
port
forever
$
action
sock
-- | Listener on the heartbeat port. Echoes back any data it was sent.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment