// $Revision: 1.3 $ // Copyright (c) 1994-1995 Taligent, Inc. All Rights Reserved. // Notification Sample 6 #ifndef TaligentSamples_SENDERCALLER #include "SenderCaller.h" #endif #ifndef TaligentSamples_RECEIVER #include "Receiver.h" #endif #ifndef Taligent_LOCALSERVICE #include #endif #ifndef Taligent_MESSAGESTREAMSTRANSPORT #include #endif int main() { TLocalObjectName serviceName("RemoteNotificationSampleServer"); TLocalServiceReference serviceReference(serviceName); TRequestSenderStream* requestStream = new TRequestSenderStream(serviceReference); TMessageStreamsTransport* transport = new TMessageStreamsTransport(requestStream); { TSenderCaller sender(transport); TReceiver receiver(&sender); sender.SetValue(101); sender.SetValue(85); sender.SetValue(280); sender.SetValue(17); sender.SetValue(1); TSystemClock().DelayFor(TSeconds(1)); // need to block thread so notifier can run } // Don't destroy transport before sender is done with it. Destroying the receiver will // disconnect its connection from the sender, which then will use the transport to inform // the other side of the RPC that notifications may not be needed. If the transport is // already gone, we die. delete transport; return 0; }