本文整理汇总了C#中IceInternal.BasicStream类的典型用法代码示例。如果您正苦于以下问题:C# BasicStream类的具体用法?C# BasicStream怎么用?C# BasicStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BasicStream类属于IceInternal命名空间,在下文中一共展示了BasicStream类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: prepareBatchRequest
prepareBatchRequest(BasicStream os)
{
lock(this)
{
while(_batchStreamInUse)
{
Monitor.Wait(this);
}
if(_batchStream.isEmpty())
{
try
{
_batchStream.writeBlob(Protocol.requestBatchHdr);
}
catch(Ice.LocalException ex)
{
throw ex;
}
}
_batchStreamInUse = true;
_batchMarker = _batchStream.size();
_batchStream.swap(os);
}
}
示例2: WSEndpoint
internal WSEndpoint(ProtocolInstance instance, EndpointI del, BasicStream s)
{
_instance = instance;
_delegate = (IPEndpointI)del;
_resource = s.readString();
}
示例3: streamToProxy
public Ice.ObjectPrx streamToProxy(BasicStream s)
{
Ice.Identity ident = new Ice.Identity();
ident.read__(s);
Reference r = instance_.referenceFactory().create(ident, s);
return referenceToProxy(r);
}
示例4: finishBatchRequest
public void finishBatchRequest(BasicStream os)
{
try
{
lock(this)
{
_batchStream.swap(os);
if(_batchAutoFlushSize > 0 && (_batchStream.size() > _batchAutoFlushSize))
{
//
// Temporarily save the last request.
//
byte[] lastRequest = new byte[_batchStream.size() - _batchMarker];
Buffer buffer = _batchStream.getBuffer();
buffer.b.position(_batchMarker);
buffer.b.get(lastRequest);
_batchStream.resize(_batchMarker, false);
int invokeNum = _batchRequestNum;
BasicStream stream = new BasicStream(_reference.getInstance(),
Ice.Util.currentProtocolEncoding);
stream.swap(_batchStream);
_adapter.getThreadPool().dispatch(() =>
{
invokeAll(stream, 0, invokeNum, true);
}, null);
//
// Reset the batch.
//
_batchRequestNum = 0;
_batchMarker = 0;
//
// Start a new batch with the last message that caused us to go over the limit.
//
_batchStream.writeBlob(Protocol.requestBatchHdr);
_batchStream.writeBlob(lastRequest);
}
//
// Increment the number of requests in the batch.
//
Debug.Assert(_batchStreamInUse);
++_batchRequestNum;
_batchStreamInUse = false;
Monitor.PulseAll(this);
}
}
catch(Ice.LocalException ex)
{
abortBatchRequest();
throw ex;
}
}
示例5: StreamWrapper
//
// Writeable stream constructor
//
public StreamWrapper(BasicStream s)
{
type_ = StreamType.Write;
s_ = s;
spos_ = s.pos();
bytes_ = new byte[254];
pos_ = 0;
length_ = 0;
}
示例6: IPEndpointI
public IPEndpointI(ProtocolInstance instance, BasicStream s)
{
instance_ = instance;
host_ = s.readString();
port_ = s.readInt();
sourceAddr_ = null;
connectionId_ = "";
_hashInitialized = false;
}
示例7: OpaqueEndpointI
public OpaqueEndpointI(short type, BasicStream s)
{
_type = type;
_rawEncoding = s.getReadEncoding();
int sz = s.getReadEncapsSize();
_rawBytes = new byte[sz];
s.readBlob(_rawBytes);
calcHashValue();
}
示例8: dumpStream
public static void dumpStream(BasicStream stream)
{
int pos = stream.pos();
stream.pos(0);
byte[] data = new byte[stream.size()];
stream.readBlob(data);
dumpOctets(data);
stream.pos(pos);
}
示例9: prepareBatchRequest
prepareBatchRequest(BasicStream os)
{
lock(this)
{
if(_exception != null)
{
throw _exception;
}
waitStreamInUse(false);
_batchStreamInUse = true;
_batchStream.swap(os);
}
}
示例10: Outgoing
public Outgoing(RequestHandler handler, string operation, Ice.OperationMode mode,
Dictionary<string, string> context, InvocationObserver observer)
{
_state = StateUnsent;
_sent = false;
_handler = handler;
_observer = observer;
_encoding = Protocol.getCompatibleEncoding(handler.getReference().getEncoding());
_os = new BasicStream(_handler.getReference().getInstance(), Ice.Util.currentProtocolEncoding);
Protocol.checkSupportedProtocol(Protocol.getCompatibleProtocol(_handler.getReference().getProtocol()));
writeHeader(operation, mode, context);
}
示例11: ConnectRequestHandler
public ConnectRequestHandler(Reference @ref, Ice.ObjectPrx proxy, Ice.ObjectDelM_ del)
{
_reference = @ref;
_response = _reference.getMode() == Reference.Mode.ModeTwoway;
_proxy = (Ice.ObjectPrxHelperBase)proxy;
_delegate = del;
_batchAutoFlush = @ref.getInstance().initializationData().properties.getPropertyAsIntWithDefault(
"Ice.BatchAutoFlush", 1) > 0 ? true : false;
_initialized = false;
_flushing = false;
_batchRequestInProgress = false;
_batchRequestsSize = Protocol.requestBatchHdr.Length;
_batchStream = new BasicStream(@ref.getInstance(), _batchAutoFlush);
_updateRequestHandler = false;
}
示例12: UdpEndpointI
public UdpEndpointI(ProtocolInstance instance, BasicStream s) :
base(instance, s)
{
if(s.getReadEncoding().Equals(Ice.Util.Encoding_1_0))
{
s.readByte();
s.readByte();
s.readByte();
s.readByte();
}
// Not transmitted.
//_connect = s.readBool();
_connect = false;
_compress = s.readBool();
}
示例13: CollocatedRequestHandler
CollocatedRequestHandler(Reference @ref, Ice.ObjectAdapter adapter)
{
_reference = @ref;
_dispatcher = _reference.getInstance().initializationData().dispatcher != null;
_response = _reference.getMode() == Reference.Mode.ModeTwoway;
_adapter = (Ice.ObjectAdapterI)adapter;
_logger = _reference.getInstance().initializationData().logger; // Cached for better performance.
_traceLevels = _reference.getInstance().traceLevels(); // Cached for better performance.
_batchAutoFlushSize = @ref.getInstance().batchAutoFlushSize();
_requestId = 0;
_batchStreamInUse = false;
_batchRequestNum = 0;
_batchStream = new BasicStream(@ref.getInstance(), Ice.Util.currentProtocolEncoding);
}
示例14: traceRecv
internal static void traceRecv(BasicStream str, Ice.Logger logger, TraceLevels tl)
{
if(tl.protocol >= 1)
{
int p = str.pos();
str.pos(0);
using(System.IO.StringWriter s = new System.IO.StringWriter(CultureInfo.CurrentCulture))
{
byte type = printMessage(s, str);
logger.trace(tl.protocolCat, "received " + getMessageTypeAsString(type) + " " + s.ToString());
}
str.pos(p);
}
}
示例15: proxyToStream
public void proxyToStream(Ice.ObjectPrx proxy, BasicStream s)
{
if(proxy != null)
{
Ice.ObjectPrxHelperBase h = (Ice.ObjectPrxHelperBase)proxy;
Reference r = h.reference__();
r.getIdentity().write__(s);
r.streamWrite(s);
}
else
{
Ice.Identity ident = new Ice.Identity();
ident.name = "";
ident.category = "";
ident.write__(s);
}
}