Skip to content
Permalink
Browse files

expose SockAddr in the callback

Consensus needs a way of identifying peers; This patch exposes the
SockAddr of the remote peer to the callback.
  • Loading branch information...
coot committed Jul 10, 2019
1 parent cbc242d commit 45b07d3b3981cb7d883b861e62e616acedd56129
@@ -70,7 +70,7 @@ subscribeTo
-> Maybe Socket.SockAddr
-> (Socket.SockAddr -> Maybe DiffTime)
-> TVar IO Int
-> (Socket.Socket -> IO ())
-> (Socket.Socket -> Socket.SockAddr -> IO ())
-> SubscriptionTarget IO Socket.SockAddr
-> IO ()
subscribeTo tbl threadPool tracer localIPv4_m localIPv6_m connectionAttemptDelay
@@ -205,14 +205,14 @@ subscribeTo tbl threadPool tracer localIPv4_m localIPv6_m connectionAttemptDelay
else return ConnectFail
traceWith tracer $ SubscriptionTraceConnectEnd remoteAddr result
case result of
ConnectSuccess -> k sd
ConnectSuccess -> k sd remoteAddr
ConnectSuccessLast -> do
outstandingConThreads <- atomically $ readTVar conThreads
mapM_ (\a -> throwTo a
(SubscriberError SubscriberParrallelConnectionCancelled
"Parrallel connection cancelled"
callStack)) outstandingConThreads
k sd
k sd remoteAddr
ConnectFail -> return ()

)
@@ -229,7 +229,7 @@ ipSubscriptionWorker
-> Maybe Socket.SockAddr
-> (Socket.SockAddr -> Maybe DiffTime)
-> IPSubscriptionTarget
-> (Socket.Socket -> IO ())
-> (Socket.Socket -> Socket.SockAddr -> IO ())
-> (Async () -> IO t)
-> IO t
ipSubscriptionWorker tbl tracer localIPv4 localIPv6 connectionAttemptDelay ips cb k =
@@ -251,7 +251,7 @@ subscriptionWorker
-> (Socket.SockAddr -> Maybe DiffTime)
-> IO (SubscriptionTarget IO Socket.SockAddr)
-> Int
-> (Socket.Socket -> IO ())
-> (Socket.Socket -> Socket.SockAddr -> IO ())
-> (Async () -> IO t)
-> IO t
subscriptionWorker tbl tracer localIPv4 localIPv6 connectionAttemptDelay getTargets valency
@@ -187,7 +187,7 @@ dnsSubscriptionWorker'
-> Maybe Socket.SockAddr
-> (Socket.SockAddr -> Maybe DiffTime)
-> DnsSubscriptionTarget
-> (Socket.Socket -> IO ())
-> (Socket.Socket -> Socket.SockAddr -> IO ())
-> (Async IO () -> IO t)
-> IO t
dnsSubscriptionWorker' tbl subTracer dnsTracer resolver localIPv4 localIPv6
@@ -208,7 +208,7 @@ dnsSubscriptionWorker
-> Maybe Socket.SockAddr
-> (Socket.SockAddr -> Maybe DiffTime)
-> DnsSubscriptionTarget
-> (Socket.Socket -> IO ())
-> (Socket.Socket -> Socket.SockAddr -> IO ())
-> (Async IO () -> IO t)
-> IO t
dnsSubscriptionWorker tbl subTracer dnsTracer localIPv4 localIPv6 connectionAttemptDelay dst cb

0 comments on commit 45b07d3

Please sign in to comment.
You can’t perform that action at this time.