Commit fef87696eb6eb2aaf698903e42a0060b0ef3b4c1
1 parent
75cde9c9
Exists in
master
server don't need to subscribe to itself
Showing
1 changed file
with
5 additions
and
7 deletions
Show diff stats
units/zmq_network.pas
... | ... | @@ -58,7 +58,6 @@ type |
58 | 58 | FOnRequestReceived: TReqRecvProc; |
59 | 59 | FContext : TZMQContext; |
60 | 60 | FPublisher, |
61 | - FSubscriber, | |
62 | 61 | FPuller, |
63 | 62 | FPusher, |
64 | 63 | FRouter, |
... | ... | @@ -248,13 +247,13 @@ begin |
248 | 247 | FreeOnTerminate := True; |
249 | 248 | FContext := TZMQContext.create; |
250 | 249 | |
251 | - // publishes for subscribers, server subscribe to itself | |
252 | - FPublisher := FContext.Socket( stPub ); | |
253 | - FSubscriber := FContext.Socket( stSub ); | |
254 | - FSubscriber.connect(CLocalHost+CPortPublisher);FSubscriber.Subscribe(''); | |
250 | + // publisher for subscribers | |
251 | + FPublisher := FContext.Socket( stPub ); // server don't need to subscribe to itself | |
255 | 252 | |
256 | - // pushes from inside to outside | |
253 | + // pull from inside and outside | |
257 | 254 | FPuller := FContext.Socket( stPull ); |
255 | + | |
256 | + // pushes from inside to outside | |
258 | 257 | FPusher := FContext.Socket( stPush ); |
259 | 258 | FPusher.connect(CLocalHost+CPortPuller); |
260 | 259 | |
... | ... | @@ -281,7 +280,6 @@ begin |
281 | 280 | FRouter.Free; |
282 | 281 | FPusher.Free; |
283 | 282 | FPuller.Free; |
284 | - FSubscriber.Free; | |
285 | 283 | FPublisher.Free; |
286 | 284 | FContext.Free; |
287 | 285 | inherited Destroy; | ... | ... |