public StandardTransferObject createTransferObject() { StandardTransferObject to = new StandardTransferObject(); to.setConnectionName(connectionName); to.setLongConnection(longConnection); to.setServerCallProxy(serverCallProxy); if (calleeClass != null) { to.setCalleeClass(calleeClass); } to.setCompress(compress); return to; }
public StandardTransferObject createTransferObject() { StandardTransferObject to = new StandardTransferObject(); to.setConnectionName(connectionName); to.setLongConnection(longConnection); to.setServerCallProxy(serverCallProxy); if (calleeClass != null) { to.setCalleeClass(calleeClass); } to.setCompress(compress); return(to); }
private void handleServerCall(object receiveObj) { byte[] receiveData = (byte[])receiveObj; TransferObject to = new StandardTransferObject(); try { to = TransferUtil.byteArrayToTransferObject(receiveData); execute(to); } catch (Exception e) { Logging.LogError("Callee Class and Method: [" + to.getCalleeClass() + "." + to.getCalleeMethod() + "]"); Logging.LogError("Handle Receive Data error: " + e); Close(mStateObject); } }
public static TransferObject byteArrayToTransferObject(byte[] byteArray){ //TransferObject to = new TransferObject(); int receiveLength = byteArray.Length; byte[] toByteArray = new byte[receiveLength - 1]; Array.Copy(byteArray, 1, toByteArray, 0, receiveLength - 1); byte flagbyte = byteArray[0]; TransferObject to = null; //check if new version of transfer object if (TransferUtil.isNewVersion(flagbyte)) { to = new NewTransferObject(); } else { to = new StandardTransferObject(); } if (TransferUtil.isCompress(flagbyte)) { toByteArray = TransferUtil.getInputByCompress(toByteArray); } else { toByteArray = TransferUtil.getInputByNormal(toByteArray); } to.setByteData(toByteArray); return to; }