Skip to content
Browse files

- moved creation of timer to connect function to prevent continuously…

… creation of timers
  • Loading branch information...
1 parent 987cfd9 commit 4cfb8b779b6e582345cfb202113bdf97198a8c08 @niclasmeier niclasmeier committed Jul 4, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/herolabs/apns/push.clj
8 src/herolabs/apns/push.clj
@@ -75,13 +75,12 @@
(defn- create-ssl-handler-factory [ssl-engine-factory] (fn [] (SslHandler. (ssl-engine-factory))))
-(defn- create-pipeline-factory [ssl-handler-factory protocoll-handler time-out]
+(defn- create-pipeline-factory [ssl-handler-factory protocoll-handler timer time-out]
"Creates a pipeline factory"
(getPipeline [this]
- (let [id-gen (AtomicInteger.)
- timer (HashedWheelTimer.)]
+ (let [id-gen (AtomicInteger.)]
(doto (Channels/pipeline)
(.addLast "ssl" (ssl-handler-factory))
(.addLast "encoder" (encoder id-gen))
@@ -103,8 +102,9 @@
boss-executor worker-executor) (ClientBootstrap.))
ssl-handler-factory (create-ssl-handler-factory engine-factory)
client-handle (atom nil)
+ timer (HashedWheelTimer.)
pipeline-factory (create-pipeline-factory ssl-handler-factory (handler bootstrap ssl-handler-factory client-handle
- exception-handler) time-out)
+ exception-handler) timer time-out)
bootstrap (doto bootstrap
(.setOption "connectTimeoutMillis" 5000)
(.setPipelineFactory pipeline-factory)

0 comments on commit 4cfb8b7

Please sign in to comment.
Something went wrong with that request. Please try again.