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,7 +58,6 @@ type | ||
| 58 | FOnRequestReceived: TReqRecvProc; | 58 | FOnRequestReceived: TReqRecvProc; |
| 59 | FContext : TZMQContext; | 59 | FContext : TZMQContext; |
| 60 | FPublisher, | 60 | FPublisher, |
| 61 | - FSubscriber, | ||
| 62 | FPuller, | 61 | FPuller, |
| 63 | FPusher, | 62 | FPusher, |
| 64 | FRouter, | 63 | FRouter, |
| @@ -248,13 +247,13 @@ begin | @@ -248,13 +247,13 @@ begin | ||
| 248 | FreeOnTerminate := True; | 247 | FreeOnTerminate := True; |
| 249 | FContext := TZMQContext.create; | 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 | FPuller := FContext.Socket( stPull ); | 254 | FPuller := FContext.Socket( stPull ); |
| 255 | + | ||
| 256 | + // pushes from inside to outside | ||
| 258 | FPusher := FContext.Socket( stPush ); | 257 | FPusher := FContext.Socket( stPush ); |
| 259 | FPusher.connect(CLocalHost+CPortPuller); | 258 | FPusher.connect(CLocalHost+CPortPuller); |
| 260 | 259 | ||
| @@ -281,7 +280,6 @@ begin | @@ -281,7 +280,6 @@ begin | ||
| 281 | FRouter.Free; | 280 | FRouter.Free; |
| 282 | FPusher.Free; | 281 | FPusher.Free; |
| 283 | FPuller.Free; | 282 | FPuller.Free; |
| 284 | - FSubscriber.Free; | ||
| 285 | FPublisher.Free; | 283 | FPublisher.Free; |
| 286 | FContext.Free; | 284 | FContext.Free; |
| 287 | inherited Destroy; | 285 | inherited Destroy; |