context | the real application using the libmsgque interface and service handles |
MqErrorCheck (MqLinkCreate ((struct ContextS *)context, argv, alfa, &context->msgque));
--App-1---|-----------App-21-----------|---App-31--
| |
| *- client211 ->|-> server31
| * |
|-> server21 -* |---App-32--
| * |
| *- client212 ->|-> server32
| |
client1 ->| ----------App-22-----------|---App-33--
| |
| *- client221 ->|-> server33
| * |
|-> server22 -* |---App-34--
| * |
| *- client222 ->|-> server34
return MqServiceCreate(ctx,"MMUL", MMUL, NULL, NULL);
ServiceCreate("MMUL", CallbackF(&mulserver::MMUL));
ServiceCreate("MMUL", MMUL);
ServiceCreate("MMUL", new MMUL());
$ctx ServiceCreate "MMUL" MMUL
ctx.ServiceCreate("MMUL",MMUL)
$ctx->ServiceCreate("MMUL",\&MMUL)
ServiceCreate("MMUL", AddressOf MMUL)
static enum MqErrorE MMUL( struct MqS *ctx, MQ_PTR data) { MQ_DBL d1,d2; MqErrorCheck (MqSendSTART(ctx)); MqErrorCheck (MqReadD(ctx, &d1)); MqErrorCheck (MqReadD(ctx, &d2)); MqErrorCheck (MqSendD(ctx, d1*d2)); error: return MqSendRETURN(ctx); }
void MMUL () { SendSTART(); SendD(ReadD() * ReadD()); SendRETURN(); }
public void MMUL () { SendSTART(); SendD(ReadD() * ReadD()); SendRETURN(); }
class MMUL implements IService { public void Service (MqS ctx) throws MqSException { SendSTART(); SendD(ReadD() * ReadD()); SendRETURN(); } }
def MMUL(ctx): ctx.SendSTART() ctx.SendD(ctx.ReadD() * ctx.ReadD()) ctx.SendRETURN()
sub MMUL {
my $ctx = shift;
$ctx->SendSTART();
$ctx->SendD($ctx->ReadD() * $ctx->ReadD());
$ctx->SendRETURN();
}
Private Sub MMUL()
SendSTART()
SendD(ReadD() * ReadD())
SendRETURN()
End Sub
1.5.8