本文整理汇总了C#中Ice.getEncoding方法的典型用法代码示例。如果您正苦于以下问题:C# Ice.getEncoding方法的具体用法?C# Ice.getEncoding怎么用?C# Ice.getEncoding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ice
的用法示例。
在下文中一共展示了Ice.getEncoding方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OpaqueEndpointI
public OpaqueEndpointI(short type, Ice.InputStream s)
{
_type = type;
_rawEncoding = s.getEncoding();
int sz = s.getEncapsulationSize();
_rawBytes = new byte[sz];
s.readBlob(_rawBytes);
calcHashValue();
}
示例2: invokeAll
private void invokeAll(Ice.OutputStream os, int requestId, int batchRequestNum)
{
if(_traceLevels.protocol >= 1)
{
fillInValue(os, 10, os.size());
if(requestId > 0)
{
fillInValue(os, Protocol.headerSize, requestId);
}
else if(batchRequestNum > 0)
{
fillInValue(os, Protocol.headerSize, batchRequestNum);
}
TraceUtil.traceSend(os, _logger, _traceLevels);
}
Ice.InputStream iss = new Ice.InputStream(os.instance(), os.getEncoding(), os.getBuffer(), false);
if(batchRequestNum > 0)
{
iss.pos(Protocol.requestBatchHdr.Length);
}
else
{
iss.pos(Protocol.requestHdr.Length);
}
int invokeNum = batchRequestNum > 0 ? batchRequestNum : 1;
ServantManager servantManager = _adapter.getServantManager();
try
{
while(invokeNum > 0)
{
//
// Increase the direct count for the dispatch. We increase it again here for
// each dispatch. It's important for the direct count to be > 0 until the last
// collocated request response is sent to make sure the thread pool isn't
// destroyed before.
//
try
{
_adapter.incDirectCount();
}
catch(Ice.ObjectAdapterDeactivatedException ex)
{
handleException(requestId, ex, false);
break;
}
Incoming @in = new Incoming(_reference.getInstance(), this, null, _adapter, _response, (byte)0,
requestId);
@in.invoke(servantManager, iss);
--invokeNum;
}
}
catch(Ice.LocalException ex)
{
invokeException(requestId, ex, invokeNum, false); // Fatal invocation exception
}
_adapter.decDirectCount();
}
示例3: sendResponse
public void sendResponse(int requestId, Ice.OutputStream os, byte status, bool amd)
{
Ice.AsyncCallback cb = null;
OutgoingAsyncBase outAsync;
lock(this)
{
Debug.Assert(_response);
if(_traceLevels.protocol >= 1)
{
fillInValue(os, 10, os.size());
}
// Adopt the OutputStream's buffer.
Ice.InputStream iss = new Ice.InputStream(os.instance(), os.getEncoding(), os.getBuffer(), true);
iss.pos(Protocol.replyHdr.Length + 4);
if(_traceLevels.protocol >= 1)
{
TraceUtil.traceRecv(iss, _logger, _traceLevels);
}
if(_asyncRequests.TryGetValue(requestId, out outAsync))
{
_asyncRequests.Remove(requestId);
outAsync.getIs().swap(iss);
cb = outAsync.completed();
}
}
if(cb != null)
{
if(amd)
{
outAsync.invokeCompletedAsync(cb);
}
else
{
outAsync.invokeCompleted(cb);
}
}
_adapter.decDirectCount();
}
示例4: streamWriteImpl
//
// Marshal the endpoint
//
public override void streamWriteImpl(Ice.OutputStream s)
{
base.streamWriteImpl(s);
if(s.getEncoding().Equals(Ice.Util.Encoding_1_0))
{
Ice.Util.Protocol_1_0.write__(s);
Ice.Util.Encoding_1_0.write__(s);
}
// Not transmitted.
//s.writeBool(_connect);
s.writeBool(_compress);
}
示例5: UdpEndpointI
public UdpEndpointI(ProtocolInstance instance, Ice.InputStream s)
: base(instance, s)
{
if(s.getEncoding().Equals(Ice.Util.Encoding_1_0))
{
s.readByte();
s.readByte();
s.readByte();
s.readByte();
}
// Not transmitted.
//_connect = s.readBool();
_connect = false;
_compress = s.readBool();
}
示例6: create
public Reference create(Ice.Identity ident, Ice.InputStream s)
{
//
// Don't read the identity here. Operations calling this
// constructor read the identity, and pass it as a parameter.
//
if(ident.name.Length == 0 && ident.category.Length == 0)
{
return null;
}
//
// For compatibility with the old FacetPath.
//
string[] facetPath = s.readStringSeq();
string facet;
if(facetPath.Length > 0)
{
if(facetPath.Length > 1)
{
throw new Ice.ProxyUnmarshalException();
}
facet = facetPath[0];
}
else
{
facet = "";
}
int mode = (int)s.readByte();
if(mode < 0 || mode > (int)Reference.Mode.ModeLast)
{
throw new Ice.ProxyUnmarshalException();
}
bool secure = s.readBool();
Ice.ProtocolVersion protocol;
Ice.EncodingVersion encoding;
if(!s.getEncoding().Equals(Ice.Util.Encoding_1_0))
{
protocol = new Ice.ProtocolVersion();
protocol.read__(s);
encoding = new Ice.EncodingVersion();
encoding.read__(s);
}
else
{
protocol = Ice.Util.Protocol_1_0;
encoding = Ice.Util.Encoding_1_0;
}
EndpointI[] endpoints = null;
string adapterId = "";
int sz = s.readSize();
if(sz > 0)
{
endpoints = new EndpointI[sz];
for(int i = 0; i < sz; i++)
{
endpoints[i] = instance_.endpointFactoryManager().read(s);
}
}
else
{
adapterId = s.readString();
}
return create(ident, facet, (Reference.Mode)mode, secure, protocol, encoding, endpoints, adapterId, null);
}