本文整理汇总了C#中IceInternal.sent方法的典型用法代码示例。如果您正苦于以下问题:C# IceInternal.sent方法的具体用法?C# IceInternal.sent怎么用?C# IceInternal.sent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IceInternal
的用法示例。
在下文中一共展示了IceInternal.sent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: flushBatchRequests
public bool flushBatchRequests(IceInternal.BatchOutgoing @out)
{
_m.Lock();
try
{
while(_batchStreamInUse && _exception == null)
{
_m.Wait();
}
if(_exception != null)
{
throw _exception;
}
if(_batchRequestNum == 0)
{
@out.sent(false);
return true;
}
//
// Fill in the number of requests in the batch.
//
_batchStream.pos(IceInternal.Protocol.headerSize);
_batchStream.writeInt(_batchRequestNum);
@out.attachRemoteObserver(initConnectionInfo(), _endpoint,
_batchStream.size() - IceInternal.Protocol.headerSize);
_batchStream.swap(@out.ostr());
bool sent = false;
try
{
OutgoingMessage message = new OutgoingMessage(@out, @out.ostr(), _batchRequestCompress, 0);
sent = sendMessage(message);
}
catch(LocalException ex)
{
setState(StateClosed, ex);
Debug.Assert(_exception != null);
throw _exception;
}
//
// Reset the batch stream.
//
_batchStream = new IceInternal.BasicStream(_instance, Util.currentProtocolEncoding, _batchAutoFlush);
_batchRequestNum = 0;
_batchRequestCompress = false;
_batchMarker = 0;
return sent;
}
finally
{
_m.Unlock();
}
}
示例2: flushAsyncBatchRequests
public bool flushAsyncBatchRequests(IceInternal.OutgoingAsyncBase outAsync, out Ice.AsyncCallback sentCallback)
{
lock(this)
{
while(_batchStreamInUse && _exception == null)
{
System.Threading.Monitor.Wait(this);
}
if(_exception != null)
{
throw _exception;
}
if(_batchRequestNum == 0)
{
sentCallback = outAsync.sent();
return true;
}
//
// Notify the request that it's cancelable with this connection.
// This will throw if the request is canceled.
//
outAsync.cancelable(this);
//
// Fill in the number of requests in the batch.
//
_batchStream.pos(IceInternal.Protocol.headerSize);
_batchStream.writeInt(_batchRequestNum);
_batchStream.swap(outAsync.getOs());
outAsync.attachRemoteObserver(initConnectionInfo(), _endpoint, 0);
//
// Send the batch stream.
//
bool sent;
try
{
OutgoingMessage message = new OutgoingMessage(outAsync, outAsync.getOs(), _batchRequestCompress, 0);
sent = sendMessage(message);
sentCallback = message.sentCallback;
}
catch(LocalException ex)
{
setState(StateClosed, ex);
Debug.Assert(_exception != null);
throw _exception;
}
//
// Reset the batch stream.
//
_batchStream = new IceInternal.BasicStream(_instance, Util.currentProtocolEncoding);
_batchRequestNum = 0;
_batchRequestCompress = false;
_batchMarker = 0;
return sent;
}
}