"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "iogateway/MessageIOGateway.cpp" between
muscle8.20.zip and muscle8.30.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

MessageIOGateway.cpp  (muscle8.20):MessageIOGateway.cpp  (muscle8.30)
skipping to change at line 578 skipping to change at line 578
if (s()) if (s())
{ {
if (timeoutPeriod != MUSCLE_TIME_NEVER) if (timeoutPeriod != MUSCLE_TIME_NEVER)
{ {
uint64 connectDuration = GetRunTime64()-timeBeforeConnect; uint64 connectDuration = GetRunTime64()-timeBeforeConnect;
timeoutPeriod = (timeoutPeriod > connectDuration) ? (timeoutPeriod-conn ectDuration) : 0; timeoutPeriod = (timeoutPeriod > connectDuration) ? (timeoutPeriod-conn ectDuration) : 0;
} }
DataIORef oldIO = GetDataIO(); DataIORef oldIO = GetDataIO();
TCPSocketDataIO tsdio(s, false); TCPSocketDataIO tsdio(s, false);
SetDataIO(DataIORef(&tsdio, false)); SetDataIO(DummyDataIORef(tsdio));
QueueGatewayMessageReceiver receiver; QueueGatewayMessageReceiver receiver;
if ((AddOutgoingMessage(MessageRef(const_cast<Message *>(&requestMessage), false)).IsOK())&&(ExecuteSynchronousMessaging(&receiver, timeoutPeriod).IsOK()) ) ret = receiver.GetMessages().HasItems() ? receiver.GetMessages().Head() : GetM essageFromPool(); if ((AddOutgoingMessage(DummyMessageRef(const_cast<Message &>(requestMessa ge))).IsOK())&&(ExecuteSynchronousMessaging(&receiver, timeoutPeriod).IsOK())) r et = receiver.GetMessages().HasItems() ? receiver.GetMessages().Head() : GetMess ageFromPool();
SetDataIO(oldIO); // restore any previous I/O SetDataIO(oldIO); // restore any previous I/O
} }
return ret; return ret;
} }
status_t MessageIOGateway :: ExecuteSynchronousMessageSend(const Message & reque stMessage, const IPAddressAndPort & targetIAP, uint64 timeoutPeriod) status_t MessageIOGateway :: ExecuteSynchronousMessageSend(const Message & reque stMessage, const IPAddressAndPort & targetIAP, uint64 timeoutPeriod)
{ {
status_t ret = B_ERROR; status_t ret = B_ERROR;
const uint64 timeBeforeConnect = GetRunTime64(); const uint64 timeBeforeConnect = GetRunTime64();
ConstSocketRef s = Connect(targetIAP, NULL, NULL, true, timeoutPeriod); ConstSocketRef s = Connect(targetIAP, NULL, NULL, true, timeoutPeriod);
if (s()) if (s())
{ {
if (timeoutPeriod != MUSCLE_TIME_NEVER) if (timeoutPeriod != MUSCLE_TIME_NEVER)
{ {
const uint64 connectDuration = GetRunTime64()-timeBeforeConnect; const uint64 connectDuration = GetRunTime64()-timeBeforeConnect;
timeoutPeriod = (timeoutPeriod > connectDuration) ? (timeoutPeriod-conn ectDuration) : 0; timeoutPeriod = (timeoutPeriod > connectDuration) ? (timeoutPeriod-conn ectDuration) : 0;
} }
DataIORef oldIO = GetDataIO(); DataIORef oldIO = GetDataIO();
TCPSocketDataIO tsdio(s, false); TCPSocketDataIO tsdio(s, false);
SetDataIO(DataIORef(&tsdio, false)); SetDataIO(DummyDataIORef(tsdio));
QueueGatewayMessageReceiver receiver; QueueGatewayMessageReceiver receiver;
if (AddOutgoingMessage(MessageRef(const_cast<Message *>(&requestMessage), false)).IsOK()) if (AddOutgoingMessage(DummyMessageRef(const_cast<Message &>(requestMessag e))).IsOK())
{ {
NestCountGuard ncg(_noRPCReply); // so that we'll return as soon as we 've sent the request Message, and not wait for a reply Message. NestCountGuard ncg(_noRPCReply); // so that we'll return as soon as we 've sent the request Message, and not wait for a reply Message.
ret = ExecuteSynchronousMessaging(&receiver, timeoutPeriod); ret = ExecuteSynchronousMessaging(&receiver, timeoutPeriod);
} }
SetDataIO(oldIO); SetDataIO(oldIO);
} }
return ret; return ret;
} }
CountedMessageIOGateway :: CountedMessageIOGateway(int32 outgoingEncoding) CountedMessageIOGateway :: CountedMessageIOGateway(int32 outgoingEncoding)
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)