Giter Site home page Giter Site logo

zyanfx / zyan Goto Github PK

View Code? Open in Web Editor NEW
88.0 11.0 38.0 28.33 MB

:gem: Zyan Communication Framework

Home Page: http://zyan.com.de

License: MIT License

C# 98.23% HTML 0.73% CSS 1.01% Batchfile 0.02%
zyan tcp linq duplex-communication rpc-framework mono rpc linq-expressions ebc encryption

zyan's People

Contributors

mikel785 avatar oleksabor avatar rikware avatar sobolev88 avatar therainbird avatar yallie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zyan's Issues

NIC selection for protocols when creating a channel

Just wanted to propose new constructors for all (network interface based) protocol implementations to allow you to specify wich NIC (ip address) you want the channel to binds to ;)

I did it by myself here, but i think it will be cool to others have this possibility!

_channelSettings["bindTo"] = _ipAddress;

when calling _channelFactory on

public override IChannel CreateChannel()

my version now is just like this:

_protocol = new TcpBinaryServerProtocolSetup(ipAddress, port);

BTW, you guys did a great job with this framework! I am currently using it as our MMORPG game servers P2P backend, for handover networked objects between servers ;)

TcpEx: invalid TCP packet crashing a running server

Got an strange issue on one of my client's servers.
The unhandled exception occurs on a thread pool I/O thread:

2018.02.13 15:14:00 Topshelf.Hosts.ConsoleRunHost: The service threw an unhandled exception
System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.EndAccept(Byte[]& buffer, Int32& bytesTransferred, IAsyncResult asyncResult)
   at System.Net.Sockets.Socket.EndAccept(IAsyncResult asyncResult)
   at Zyan.Communication.Protocols.Tcp.DuplexChannel.Manager.listener_Accept(IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Manager.cs:line 241
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Turns out to be an issue with some monitoring software.
The monitor seems to be pinging known addresses and immediately
closing the connection as long as it sees that the remote party is listening:

image

Seems that Zyan doesn't handle this situation properly (Manager.cs: line 241):

Socket client;
try
{
	client = listener.EndAccept(ar); // ** unhandled SocketException here**

	// Wait for next Client request
	listener.BeginAccept(new AsyncCallback(listener_Accept), new object[] { listener, channel });
}
catch (ObjectDisposedException ex)
{
	// the listener was closed
	Trace.WriteLine("TcpEx.Manager: the listener was closed. Got exception: " + ex.ToString());
	return;
}

The solution seems to be simply ignore the broken incoming connection.

Shared creation policy is not applied

Shared creation policy is not applied when ZyanComponent is imported on the server-side.
Two instances are created instead of one.

How to reproduce:

  1. Creating shared service

[ZyanComponent(typeof (ITelphinService))]
[PartCreationPolicy(CreationPolicy.Shared)]
public partial class TelphinService : ITelphinService
{
public event EventHandler Answered;

public void OnAnswered(EventArgs args)
{
    Answered.SafeInvoke(null, args);
}

}

  1. Subscribe to event on client-side

TelphineService.Answered += new EventHandler(TelphinService_Answered);

  1. Raise event on server-side:
    [Import]
    private ITelphinService TelphinService { get; set; }

TelphinService.OnAnswered(new EventArgs());

  1. Event is not raised on client-side

ZyanConnection memory leak

A simple sample.
code

P.S. Sorry for open issue where say what leak memory in ZyanConnectionHost. It's all my fault.

Porting from .Net framework to .Net core

Hello

I am trying to port my project on .Net CORE (Visual Studio 2017 on Windows and OSX). Unfortunately, Zyan is only supported by .Net Framework.

error output:

Install-Package : Das Paket Zyan 2.8.0 ist nicht mit netcoreapp1.1 (.NETCoreApp,Version=v1.1) kompatibel. Paket Zyan 2.8.0 unterstützt Folgendes:

  • monoandroid10 (MonoAndroid,Version=v1.0)
  • net35 (.NETFramework,Version=v3.5)
  • net40 (.NETFramework,Version=v4.0)
  • net45 (.NETFramework,Version=v4.5)
  • net46 (.NETFramework,Version=v4.6)
    ...

Is there a way to use the package also under .Net core?

Thx and cya Thommy

Disposing session of crasehd client

Hey yallie,

I'm using your Framework for a .NET solution.
So far I got everything working as I want it to, but as soon as a client crashes (/ is being force closed via the Windows task manager) the server gets an immense performance hit. That does not happen when the client is properly shut down (and the connection disposed).

So, my guess is that the session of the crashed client is kept alive and causes issues.
Is there a best practice for checking up and disposing session from the server side?

Thanks in advance.

Regards, Fabian.

Zyan exception {"Public key changed since the message was encrypted."}

Hey.

Before a while i got this exception and then i had the client and server and Interface on the same assembly.
And i have fixed it by using Tcp and Ipc protocols but i have no idea about the published component has Tcp or Ipc protocol or the same component which published by using TCP only?
After that i have separated them i mean client has his own assembly also interface and server and tried to use Tcp protocol only but i'm still getting the same exception.
Can you help me please?

regards/Hassan.

Equals different between proxies

Hello,

i have an issue when i retrieve objects with nested objects.

There are two Proxies with the Functions:
GetAutos1(), GetAutos2() and GetMarken():

public interface IAuto
{
	System.Collections.Generic.List<Auto> GetAutos1();		
	System.Tuple<System.Collections.Generic.List<Auto>, System.Collections.Generic.List<Marke>> GetAutos2();
}
public interface IMarke
{
	System.Collections.Generic.List<Marke> GetMarken();
}
[System.Serializable]
public class Auto
{
	public System.Guid Id { get; set; }
	public string Farbe { get; set; }
	public Marke Marke { get; set; }
}
[System.Serializable]
public class Marke
{
	public System.Guid Id { get; set; }
	public string Name { get; set; }
}

Szenrio 1

var marken = connection.CreateProxy<Shared.IMarke>("Marke").GetMarken();
var auto = connection.CreateProxy<Shared.IAuto>("Auto").GetAutos1()[0];

But if i use object.Equals(marken[0], auto.Marke) ... object.Equals(marken[n], auto.Marke), it's allways False.

Szenrio 2

var items = connection.CreateProxy<Shared.IAuto>("Auto").GetAutos2();
var marken = items.Item2;
var auto = items.Item1[0];

Now it works correctly. If i use object.Equals(marken[0], auto.Marke) ... object.Equals(marken[n], auto.Marke), n-1 times the Result is False and one time the Reult is True.

What can i do, that "Szenario 1" works also correct? Or is it an issue in Zyan?

Thanks in advance

Event was not raised in client application

I create a sample from your android client example.
I make Android app as a server and WinForm application as a client.
everything worked, but my custom event was not raised in client application.
where am I doing wrong?
thank you.
sample code.zip

Returning interfaces / auto create proxies

I just played around a bit with your framework and ended up having a question:

A proxy object returns an interface. Zyan complains if the class implementing the interface is not serializable. If it is, in fact a new instance is created on the client side.

How to accomplish having a proxy created automatically instead?

Something like:

interface IParent
{
IChild GetChild();
}

interface IChild
{
}

class Child : IChild
{
}

I would like that when calling GetChild on the client side, a transparent proxy for the corresponding instance on the server side is created and not an own instance of Child.

Increasing threads/CPU usage

I've been using Zyan.Communication.dll v2.8.0.0 with my C# code in Windows services on Windows Server 2012 and am pleased with it so far.

However, I've run into an issue when attempting to restore a Zyan connection, or create a new one, when a connection has been broken. I notice that new threads are created that never die, even if I dispose of ZyanConnection objects. This might also lead to increases in CPU usage.

Perhaps you can give me an idea of best practices, which hopefully will resolve the issue. What I do now if there is a disconnection (for instance, by stopping a service) is to dispose of the ZyanConnection object and attempt to create a new one. Here is a code snippet.

        if (_connection != null)
        {
            _connection.PollingEnabled = false;
            _connection.Dispose();
        }

        _connection = new ZyanConnection(ServerUrl, CommProxyStorage.I.ProtocolSetup, false);
        _asteriskProxy = _connection.CreateProxy<BI.IAsteriskProxy>();

(The protocol is TcpDuplexClientProtocolSetup with encryption set to true.)

I have a Timer with a short interval (100 milliseconds) check for channels that are disconnected (a flag set by the Disconnection event) and try to create a new connection. When there is a disconnection, the thread count goes steadily upwards, and when there is a connection possible, the code works fine to create a new, working connnection, but the "extra threads" remain. I don't think that the Timer itself is the cause of the extra threads.

Could this be an issue with Zyan, and how can I resolve this? I'd like an effective way to restore a connection that has been lost without increasing the thread count in a "permanent" way.

Error receiving message; Zyan.Communication.Protocols.Tcp.DuplexChannel.MessageException: Connection closed. ---> System.Net.Sockets.SocketException

Dear all,

I'm trying to implement the Zyan TCP duplex scenario with one server (as a windows service) and two clients. Currently I'm using Zyan 2.11 and SafeDeserializationHelpers v0.5

Ok let me explain which issue i face. I created the server as a windows service with the following code:
`
private ZyanComponentHost server;

    public MT5TerminalServer()
    {
        InitializeComponent();
    }

    protected override void OnStart(string[] args)
    {
        TcpDuplexServerProtocolSetup protocol = new TcpDuplexServerProtocolSetup(Constants.ZYAN_PORT, null, true);
        server = new ZyanComponentHost(Constants.ZYAN_CHANNEL, protocol);
        server.RegisterComponent<ISharedObject, SharedObject>(ActivationType.Singleton);
        //server.EnableDiscovery();
    }

`

Constants:

`
public const int ZYAN_PORT = 8081;

    public const string ZYAN_SERVER = "localhost";

    public const string ZYAN_CHANNEL = "MT5Terminal";

public static string GetServerAddress()
{
return string.Format("tcpex://{0}:{1}/{2}", Constants.ZYAN_SERVER, Constants.ZYAN_PORT, Constants.ZYAN_CHANNEL);
}`

My SharedObject looks like
`public interface ISharedObject
{
#region Properties
SymbolInfo SymbolInfo { get; set; }
OrderQueue OrderQueue { get; set; }
AccountInfo AccountInfo { get; set; }
Chart Chart { get; set; }
TerminalEvent TerminalEvent { get; set; }
Preferences Preferences { get; set; }
Fibo Fibo { get; set; }
#endregion

    #region Events
    event Action<SymbolInfo> SymbolChanged;
    event Action<SymbolInfo> NewSymbolSelected;
    event Action<Chart, Chart> NewChartOpened;
    event Action<Chart> ChartClosed;
    #endregion
}`

My clients are connecting with
`ZyanConnection connection = null;
TcpDuplexClientProtocolSetup protocol = new TcpDuplexClientProtocolSetup(true);

            try
            {
                connection = new ZyanConnection(Functions.GetServerAddress(), protocol);

                ISharedObject proxy = connection.CreateProxy<ISharedObject>();
                proxy.SymbolInfo = new SymbolInfo(symbolInfo);
                proxy.AccountInfo = new AccountInfo(accountInfo);
                proxy.Chart = new Chart(chart);

                return_code = (int)ENUM_LIBRARY_RCODE.RCODE_OK;
            }
            catch (Exception e)
            {
                Logger.AppendMessageToEventLog(ENUM_LOGGER.LOGGER_TERMINAL, e);

                return_code = (int)ENUM_LIBRARY_RCODE.RCODE_FAILED;
            }`

But at line
proxy.SymbolInfo = new SymbolInfo(symbolInfo);

i get the following error message
`mscorlib; Error receiving message; Zyan.Communication.Protocols.Tcp.DuplexChannel.MessageException: Connection closed. ---> System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
--- Ende der internen Ausnahmestapelüberwachung ---
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Message.EndReceive(Connection& connection, IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Message.cs:Zeile 176.;
Server stack trace:
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Message.EndReceive(Connection& connection, IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Message.cs:Zeile 222.
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Manager.ReceiveMessage(IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Manager.cs:Zeile 310.
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Manager.EndReadMessage(Connection& connection, IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Manager.cs:Zeile 415.
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.ClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\ClientTransportSink.cs:Zeile 98.
bei Zyan.Communication.ChannelSinks.Encryption.CryptoClientChannelSink.ProcessEncryptedMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\ChannelSinks\Encryption\CryptoClientChannelSink.cs:Zeile 225.
bei Zyan.Communication.ChannelSinks.Encryption.CryptoClientChannelSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\ChannelSinks\Encryption\CryptoClientChannelSink.cs:Zeile 258.
bei Zyan.Communication.ChannelSinks.Compression.CompressionClientChannelSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\ChannelSinks\Compression\CompressionClientChannelSink.cs:Zeile 175.
bei Zyan.SafeDeserializationHelpers.Channels.SafeBinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei Zyan.Communication.IZyanDispatcher.Invoke(Guid trackingID, String interfaceName, List`1 delegateCorrelationSet, String methodName, Type[] genericArguments, Type[] paramTypes, Object[] args)
bei Zyan.Communication.ZyanProxy.InvokeRemoteMethod(IMethodCallMessage methodCallMessage) in D:\Externals\Zyan\source\Zyan.Communication\ZyanProxy.cs:Zeile 560.

Exception rethrown at [1]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei MT5Library.TerminalCommunication.ISharedObject.set_SymbolInfo(SymbolInfo value)
bei MT5Library.MT5Library.SendData(MT5SymbolInfo& symbolInfo, MT5AccountInfo& accountInfo, MT5Chart& chart) in D:\Dropbox\Documents\Visual Studio 2017\source\repos\MT5_V2P0\MT5Library\MT5Library.cs:Zeile 36.; Zyan.Communication.Protocols.Tcp.DuplexChannel.MessageException: Error receiving message ---> Zyan.Communication.Protocols.Tcp.DuplexChannel.MessageException: Connection closed. ---> System.Net.Sockets.SocketException: Eine vorhandene Verbindung wurde vom Remotehost geschlossen
--- Ende der internen Ausnahmestapelüberwachung ---
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Message.EndReceive(Connection& connection, IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Message.cs:Zeile 176.
--- Ende der internen Ausnahmestapelüberwachung ---

Server stack trace:
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Message.EndReceive(Connection& connection, IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Message.cs:Zeile 222.
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Manager.ReceiveMessage(IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Manager.cs:Zeile 310.
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.Manager.EndReadMessage(Connection& connection, IAsyncResult ar) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\Manager.cs:Zeile 415.
bei Zyan.Communication.Protocols.Tcp.DuplexChannel.ClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\Protocols\Tcp\DuplexChannel\ClientTransportSink.cs:Zeile 98.
bei Zyan.Communication.ChannelSinks.Encryption.CryptoClientChannelSink.ProcessEncryptedMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\ChannelSinks\Encryption\CryptoClientChannelSink.cs:Zeile 225.
bei Zyan.Communication.ChannelSinks.Encryption.CryptoClientChannelSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\ChannelSinks\Encryption\CryptoClientChannelSink.cs:Zeile 258.
bei Zyan.Communication.ChannelSinks.Compression.CompressionClientChannelSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream) in D:\Externals\Zyan\source\Zyan.Communication\ChannelSinks\Compression\CompressionClientChannelSink.cs:Zeile 175.
bei Zyan.SafeDeserializationHelpers.Channels.SafeBinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei Zyan.Communication.IZyanDispatcher.Invoke(Guid trackingID, String interfaceName, List`1 delegateCorrelationSet, String methodName, Type[] genericArguments, Type[] paramTypes, Object[] args)
bei Zyan.Communication.ZyanProxy.InvokeRemoteMethod(IMethodCallMessage methodCallMessage) in D:\Externals\Zyan\source\Zyan.Communication\ZyanProxy.cs:Zeile 560.

Exception rethrown at [1]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei MT5Library.TerminalCommunication.ISharedObject.set_SymbolInfo(SymbolInfo value)
bei MT5Library.MT5Library.SendData(MT5SymbolInfo& symbolInfo, MT5AccountInfo& accountInfo, MT5Chart& chart) in D:\Dropbox\Documents\Visual Studio 2017\source\repos\MT5_V2P0\MT5Library\MT5Library.cs:Zeile 36.`

I really dont know why. I've also deactivated the firewall to check if there is anything blocked, but without success.
May you can give me some hints? Thank you!

BR

ZyanConnection strange thread behaviour on Unity3D

Hi,

We are using Zyan inside Unity3D instances to connect our game servers together. One issue we are experiencing is:

  1. We start UnityEditor play mode and instantiates a ZyanConnection that connects to a ZyanComponentHost. It works as expected, everything is fine. We can send our objects to the other server.

  2. We stop UnityEditor play mode;

  3. We start UnityEditor play mode again, expecting the same behaviour as on item 1, but UnityEditor hangs and analyzing the wait chain of the UnityEditor process I found the following message: One or more threads on Unity.exe are waiting to finish network I/O

Something related to the threads inside the ZyanConnection are locking the process... I know its related to ZyanConnection becuase I did an .NET Console Application that connects to the same ZyanComponentHost used on item 1 and UnityEditor do not hangs after restarting the play mode.

I don't know if I am giving enough info, but maybe you guys can have a clue because you know better the code than me and I hadn't enough time to investigate inside your code yet too...

thread_hangs

I can not send data in datatable to the server

Hello

I would like to be able to help me, I am trying to send a table with data to the server and when I get to the server insert the records sent to the database but it sends me error that does not find the assembly, but if I comment the code where the value is assigned to the field Table if it arrives at the server but what I need is that the values of the table also arrive. I clarify that to return value in the field of table type of the server to the client if it realizes it.

// SHARED 
public interface IService : IDisposable
{
    /// <summary>
    //Aqui se encuentran las declaraciones la firma de los 
    //metodos remotos los cuales pueden ser accesados desde el     cliente sin conocer su implementación
    MyData GuardarVenta(MyData datos);
}

// SHARED 
[Serializable] 
public class MyData 
{
   public string Cadena1 { get; set; }
   public string Cadena2 { get; set; }
   public int Entero1 { get; set; }
   public int Entero2 { get; set; }
   public DateTime FechaInicio { get; set; }
   public DateTime FechaFinal{ get; set; }
   public DataTable MyTable  { get; set; }
   public DataTable MyTable2 { get; set; }
} 

// SERVER 
public MyData GuardarVenta(MyData datos)
{
 //...processdata
 datos.MyTable = midataset.Tables[0]; 
 return datos;  ///retorno el objeto con la tabla que fue llenada por el procedimiento almacenado    
}

// CLIENT
public MyData GuardarVenta(DataTable datos, int id_empleado, int id_cliente, int createdby, int updatedby, int vendedor)
{
        MyData Datostabla = new MyData();
        Datostabla.MyTable = datos;
        Datostabla.Cadena1 = id_empleado.ToString() + "^" + id_cliente.ToString() + "^" + createdby.ToString() + "^" + updatedby.ToString() + "^" + vendedor.ToString();
        Datostabla = service.GuardarVenta(Datostabla);
        return Datostabla;
}

Error:

System.Runtime.Serialization.SerializationException was unhandled 
HResult=-2146233076 
Message=No se puede encontrar el ensamblado 'SystemHPP.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 
Source=mscorlib 
StackTrace:
Server stack trace: 
   en System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   en System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   en System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   en System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   en System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   en System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   en System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   en System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.UnsafeDeserialize(Stream serializationStream, HeaderHandler handler)
   en System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
   en System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
Exception rethrown at [0]: 
   en System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   en System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   en Zyan.Communication.IZyanDispatcher.Invoke(Guid trackingID, String interfaceName, List`1 delegateCorrelationSet, String methodName, Type[] genericArguments, Type[] paramTypes, Object[] args)
   en Zyan.Communication.ZyanProxy.InvokeRemoteMethod(IMethodCallMessage methodCallMessage) en d:\Externals\Zyan\source\Zyan.Communication\ZyanProxy.cs:línea 484
Exception rethrown at [1]: 
   en System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   en System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   en Zyan.Examples.SystemHPP.Shared.IService.GuardarVenta(MyData datos)
   en SystemHPP.Client.Funciones.GuardarVenta(DataTable datos, Int32 id_empleado, Int32 id_cliente, Int32 createdby, Int32 updatedby, Int32 vendedor) en C:\Users\Lety\Desktop\FRAMEWORK ZYAN\Zyan_SystemHPP\examples\Zyan.SystemHPP\Zyan.SystemHPP.Client\Funciones.cs:línea 51
   en SystemHPP.Client.Frm_PuntoVenta.realizar_operacion_venta() en C:\Users\Lety\Desktop\FRAMEWORK ZYAN\Zyan_SystemHPP\examples\Zyan.SystemHPP\Zyan.SystemHPP.Client\Frm_PuntoVenta.cs:línea 465
   en SystemHPP.Client.Frm_PuntoVenta.tsbguardar_Click(Object sender, EventArgs e) en C:\Users\Lety\Desktop\FRAMEWORK ZYAN\Zyan_SystemHPP\examples\Zyan.SystemHPP\Zyan.SystemHPP.Client\Frm_PuntoVenta.cs:línea 427
   en System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   en System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   en System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   en System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   en System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   en System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   en System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   en System.Windows.Forms.Control.WndProc(Message& m)
   en System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   en System.Windows.Forms.ToolStrip.WndProc(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   en System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   en System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   en System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   en System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   en System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   en System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   en System.Windows.Forms.Application.Run(Form mainForm)
   en Zyan.Examples.SystemHPP.Client.Program.Main() en C:\Users\Lety\Desktop\FRAMEWORK ZYAN\Zyan_SystemHPP\examples\Zyan.SystemHPP\Zyan.SystemHPP.Client\Program.cs:línea 22
   en System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   en System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   en System.Threading.ThreadHelper.ThreadStart()

Session filters

Fix the behavior of session filters.
When a session is not yet established (SessionID is null), the subscriber gets all events because the filter allows empty SessionID. So the tracing log is littered with lots of irrelevant entries.

Handle connection fault

just wondering for a duplex connect, if the server crash, how is the client notified of such event? it seems like ZyanConnection.Error event won't fired when the server stop/failed.

No remote address specified for reconnect.

Sometimes clients to report the following error/exception, which seems to happen unfrequently, but sometimes.

Do you know what might be causing this?
Many Thanks in advance...
Bernd

Error Message: No remote address specified for reconnect.
Error Type: System.Runtime.Remoting.RemotingException
Error Source: Zyan.Communication.Void CheckSocket()
********** System Stack Trace **********
à Zyan.Communication.Protocols.Tcp.DuplexChannel.Connection.CheckSocket()
à Zyan.Communication.Protocols.Tcp.DuplexChannel.Connection.get_Writer()
à Zyan.Communication.Protocols.Tcp.DuplexChannel.Message.Send(Connection connection, Guid guid, ITransportHeaders headers, Stream message)
à Zyan.Communication.Protocols.Tcp.DuplexChannel.ServerTransportSink.ReceiveMessage(IAsyncResult ar)
à Zyan.Communication.Protocols.Tcp.DuplexChannel.Manager.AsyncResult.DoCallback(Object o)
à System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
à System.Threading.ThreadPoolWorkQueue.Dispatch()
à System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

ISessionTransformFilter

The use case:

  1. Suppose we have an event carrying lots of data. Say, all pages of a book.
  2. And a filter for this event. Say, containing a list of keywords.
  3. And a subscriber who wants only the matched part of an event. Say, only the pages that contain matching keywords.

The current event filtering API doesn't allow this.
If a filter changes the event arguments, all subscribers get the the changed data.
But we want to broadcast the changed event data to the filtered subscriber.
All other subscribers should get the original data.

Activaton-Type

First, thanks for the Zyan-Component :)

Is it possible to create a proxy, wich creates in the server an class-instance that is singleton for the scope?

var proxy = zyanConnection.CreateProxy< IFunctions>();
proxy.Id = 1;

var proxy2 = zyanConnection.CreateProxy< IFunctions>();
proxy2.Id = 2;

var id1 = proxy.Id;
var id2 = proxy2.Id;

If i declare the registration as singleton the results are:
id1 = 2; id2 = 2

If i declare the registration as single-call the results are:
id1 = 0; id2 = 0

Now my question whether Zyan can be used for the behavior that the results are "id1 = 1" and "id2 = 2"?

Thanks in advance

Is the execution of an event on the client asynchronious?

I have a TcpDuplexServerProtocolSetup server, which implements the following service:

/// <summary>
/// Raised by the server to invoke the execution to resolve a macro on the client.
/// <para>The delegate must have the signature: string Func(string macro)</para>
/// </summary>
event Func<string, string> EvalMacroReceived;

/// <summary>
/// Executes a control-command on the server.
/// </summary>
/// <param name="command">The control-command to execute.</param>
/// <returns>The reply string.</returns>
string ExecuteCommand(ControlCommand command);

When I am calling the 'ExecuteCommand' method from the client, to invoke it on the server-side, all is fine!

The client subscribes to the 'EvalMacroReceived' event.
When the server now invokes this event, the related method is actually called on the client also just fine.
BUT, the invokation on the server immediately returns with a NULL return value.
Thus, the server is unable to retrieve the actual return value of the client.

This is how the server invokes the event:

internal string RaiseEvalMacroReceived(string macro)
{
    if (EvalMacroReceived != null)
    {
        try
        {
            return EvalMacroReceived(macro);
        }
        catch { return String.Empty; }
    }
    return String.Empty;
}

This is how the client handles the event:

TcpDuplexClientProtocolSetup protocol = new TcpDuplexClientProtocolSetup(true);
Connection = new ZyanConnection(serverUrl, protocol, Credentials, false, true);
Connection.PollingInterval = TimeSpan.FromSeconds(15);
Connection.PollingEnabled = true;

RemoteProxy = Connection.CreateProxy<MyService>();
RemoteProxy.EvalMacroReceived += RemoteProxy_EvalMacroReceived;

private string RemoteProxy_EvalMacroReceived(string macro)
{
    return "Test";
}

Any idea, if this is a bug or if I am doing anything wrong or if invoking an event on the client side is always asynchronious and as such I can never get the return value of the delegate function back correctly?!

I am pretty sure, that this had worked in v2.5 and got somehow broken in v2.8 - but I am not entirely sure.

Many Thanks in advance,
Bernd

Integrate GenuineChannels

http://github.com/zyanfx/GenuineChannels

  • Publish GenuineChannels library as a Nuget package
  • Update GenuineChannels project to the latest build tools
  • Get rid of ICSharpCode.SharpZipLib dependency or turn it into Nuget reference
  • Create integration tests to ensure backwards compatibility with published v2.5.9.9
  • Set up Zyan.GenuineChannels repository
  • Create protocol setup classes
  • Prepare Nuget package

Performance after Decompression

Hi yallie,

i have an issue in the client after decompression.

I have include the source code of zyan in my project and have set break points.

In my project i have realized a performance issue:

  1. Server: reads data from sql server, created objects from the results and sends the objects in a list to the client (duration: 2 seconds) ok
  2. Client: zyan receives data and decompress data (duration: < 1 second) ok
  3. Client: zyan works with the data and gives the data to my project (duration: 2 - 3 seconds) slow?

The compressed data size is: 0,81 MB and after descompression in the client 3,93 MB.

Points 1 and 2 are ok but point 3 is, in my view in this project, too slow?

Please can you check, whether there is an performance lack after decompression?
Because the performace until after the descompression is very good :)

Many thanks in advance

64bit dll

Dear team,

thank you for providing us such a great framework.
while implementing this framework in my applications I faced some issues regarding 32bit and 64bit.

My applications are only running in 64bit (c# > properties > 64bit - not anycpu!!) and cant run your dll's (Zyan.SafeDeserializationHelpers.dll, ZyanCommunication.dll because they'd compiled with anycpu / or 32 bit.

Is it possible to provide me a x64 version of your framework?

Thank you
BR

Hanging client side

Hello .

I'm using Zyan with my chat service but when i create ZyanConnection in client side the connection is established between server and the client but the program is just hanging and no more executing ,But when i tried to connect to other service with other IP and the other one is also using Zyan it worked fine,Anyone can help me with this please?

Thank you/Hassan.

Register components with two interfaces

Hello Alex,

is it possible to register a component as a singleton but accessible via two different interfaces?

Let's say we have the following interfaces and classes:

IFoo.cs

public interface IFoo
{
    string Echo(string text);
    Action<string> Bar { get; set; } 
}

IFoo2.cs

public interface IFoo2
{
    Action<string> Bar2 { get; set; } 
}

Foo.cs

public class Foo : IFoo, IFoo2 
{
    public Action<string> Bar { get; set; }
    public Action<string> Bar2 { get; set; }
    public Guid Echo(string text)
    {
        Bar?.Invoke(text);
        Bar2?.Invoke(text);
        return text;
    }
}

I now want to register the component Foo somehow like

ZyanComponentHost Host = ...
Host.RegisterComponent<IFoo, Foo>(ActivationType.Singleton);
Host.RegisterComponent<IFoo2, Foo>(ActivationType.Singleton);

so that two different clients can connect to the the same instance of Foo but using different interfaces for the Proxy.

Is that possible?

Regards
Alex :)

ZyanComponentHost memory leak

Code from demo :
var host = new ZyanComponentHost("ZyanDemo", 8080);

If ZyanComponentHost was created, then all is fine. But if we only launch our service and connection was not created, then we will have memory leak. in Zyan I'm not found how check URL and I create ZyanComponentHost in while in my Task with Thread.Sleep in 1 second. And I have memory leak. For services it's huge problem. Need mechanism check availability URL or fix memory leak.

DI in Component

Hello yallie,

is it possible to inject a property to a component automatically?

E.g.:
public string Info { get; set; }
While create the instance from the interface, the server inject in the property a pre-definied value.
Now the client can work with the property.
MessageBox.Show(proxy.Info);

Best regards and thanks in advance

csharpdeveloper12

Capture client-side call stack

Zyan events can be used to trace server-side events like SQL queries, permission checks, etc.
Capturing server-side call stack is straightforward.
But the whole picture needs a client-side call stack as well.

TODO: add the ability to capture client-side call stack on remote calls.
Of course it must be optional (and disabled by default) because it's quite an expensive operation.

Original issue: http://zyan.codeplex.com/workitem/2527

ZyanConnection with Auth results in "Attempting to deserialize empty stream"

My Server Code:

        var authProv = new DBAuthenticationProvider(); // Doesn't work with either...
        //var authProv = new BasicWindowsAuthProvider();
        var protocolSetup = new TcpCustomServerProtocolSetup(8080, authProv);

        host = new ZyanComponentHost("DaMaSchGameServer", protocolSetup);
        Console.WriteLine("Host up");

        host.RegisterComponent<Services.ITimeService, Services.TimeService>();
        Console.WriteLine("Service up");

        Console.ReadKey();
        Console.WriteLine("Shutting down");
        host.UnregisterComponent<Services.ITimeService>();

My Client code:

        var credentials = new Hashtable();
        credentials.Add(AuthRequestMessage.CREDENTIAL_USERNAME, "username");
        credentials.Add(AuthRequestMessage.CREDENTIAL_PASSWORD, "hunter2");

        var protocolSetup = new TcpCustomClientProtocolSetup(false);

        // The following line produces the error:
        connection = new ZyanConnection(
            "tcp://localhost:8080/DaMaSchGameServer",
            protocolSetup,
            credentials,
            false,
            true);

        timeservice = connection.CreateProxy<GameServer.Services.ITimeService>();

When I don't use Authentication everything works. But when I use my own AuthProvider or the BasicWindowsAuthProvider I get this exception:

Attempting to deserialize an empty stream.

Server stack trace:
bei System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
bei System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel securityLevel)
bei System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)

Exception rethrown at [0]:
bei System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
bei System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
bei Zyan.Communication.IZyanDispatcher.Logon(Guid sessionID, Hashtable credentials)
bei Zyan.Communication.ZyanConnection..ctor(String serverUrl, IClientProtocolSetup protocolSetup, Hashtable credentials, Boolean autoLoginOnExpiredSession, Boolean keepSessionAlive) in D:\Externals\Zyan\source\Zyan.Communication\ZyanConnection.cs:Zeile 228.
bei Zyan.Communication.ZyanConnection..ctor(String serverUrl, IClientProtocolSetup protocolSetup, Hashtable credentials, Boolean autoLoginOnExpiredSession, Boolean keepSessionAlive) in D:\Externals\Zyan\source\Zyan.Communication\ZyanConnection.cs:Zeile 240.
bei ClientWindows.Program.Main() in C:\Users\dschachtler\Documents\Visual Studio 2015\Projects\ZyanGameNetwork\ClientWindows\Program.cs:Zeile 30.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()

is service discovery feature ready?

maybe I was reading something out of date on the internet but is the service discovery feature ready for production?
also would it be a good idea to add support for router port forwarding within the framework?

Great work!

Restoring event subscriptions code is faulty

Zyan currently uses subscription counters and checks if they match on client and server. But we can't rely on them if we're making concurrent calls with subscriptions/unsubscriptions. Zyan detects the mismatch and starts re-subscribing even if it actually doesn't need to. It doesn't break anything, just generates some parasite network traffic.

Zyan with Windows and Mono on Linux Raspberry

Hi Yallie,

here is a little bit about my Zyan project on Windows, Linux and Linux on Raspberry PI 2/3.
The project is about a Time Tracking Solution, Raspberry PI with Touch Panel 3,5" and RFID reader. Should act as time tracking terminal and optional as area access terminal via a relay or led to simulate access.

All the components are wired on a breadboard and are working fine. Raspberry IO are managed via Raspberry IO General Purpose assembly on NuGet.

The environment is as following:

I have a Windows Zyan Host (Dispatcher) running as service.
I have 4 Zyan Hosts called Agent, 1 on Windows, 1 on Linux Ubuntu with Mono and 2 on Linux Ubuntu with Mono on Raspberry PI 3b.

The Windows Dispatcher is the central program making requests to the clients (agents) and receives request from the clients (agents).

Windows Agent and Linux Agent on Ubuntu are only for testing/debugging purpose. The two Raspberry Linux Agents are the real time tracking and area access terminals.

Raspberry agents have MongoDB locally installed and save the actual time bookings in the database and send a time booking request to the dispatcher (windows service) if available. If not available, later the dispatcher tries to get the bookings from the agents.

Bidirectional Communication and it works.. (Windows <-> Linux/Mono, Windows <-> Raspberry/Mono, Linux/Mono <-> Raspberry/Mono)

But...I have some strange behavior:

Sending request from the dispatcher:

 - to a windows agent
   (works fine within milliseconds)

 - to a linux/ubuntu/mono agent
   (does not work on first call, after a retry the request it works within milliseconds)

 - to a linux/ubuntu/mono/raspberry
   (same behavior as before)

If a make a "QueryAlive" request to all my agents, the first Linux/Mono gets an error with the following message:

Cannot create channel sink to connect to URL /98b09d86_a7b0_4134_91fd_a73b5be56b4a/tuemzdslijppnf8agyjtj7li_3.rem. An appropriate channel has probably not been registered.

If I try it just after this call, every is fine. First call does not succeed.

Every agent has a method to send booking data to the dispatcher, this is the behavior:

 - sending from windows/agent to windows/dispatcher
   (everything is fine within milliseconds)

 - sending from ubuntu/mono real workstation to windows/dispatcher
   (everything is fine within milliseconds)

 - sending from Raspberry/ubuntu/mono to windows/dispatcher
   (works, but the time connection to dispatcher varies from 3 to 12 seconds) 

This is my method to contact the agents/dispatcher...

using (var conn = new ZyanConnection(url, protocol))
{
var proxy = conn.CreateProxy();
var ts = proxy.QueryAlive();
}

Any idea about this behavior???
But it works with the workarounds.

Thanks, Jens.

Passing null instead of credentials

Hi Alex,

Shouldn't

		public ZyanConnection(string serverUrl, Hashtable credentials, bool autoLoginOnExpiredSession, bool keepSessionAlive)
			: this(serverUrl, ClientProtocolSetup.GetClientProtocol(serverUrl), null, autoLoginOnExpiredSession, true)
		{
		}

in ZyanConnection.cs be passing credentials and not null?

Greetings
Alex

Hosting on IIS

Can we host this on IIS / remote WebHosting site ? if yes, then please share some details.

Xamarin.iOS compatibility

Hello,

I would like to ask if there are any chances for Xamarin.iOS compatibility, is it just untested or will it not work by design? I want to develop a project which has a Xamarin.iOS server and different client platforms (e.g. Xamarin.iOS, Xamarin.Android and plain old Windows C#.)

Another question: Are there any plans to support .NET Standard?

Thanks

CurrentSession app-domain

Hello yallie,

it's me again :)

I have a method "IProxy.Method" which invokes an external method in an external assembly (which references Zyan). This external method reads "Zyan.Communication.ServerSession.CurrentSession.Identity.Name" and works with the property.

Now my question: Is it safe if multiple clients/users invokes "IProxy.Method"? My apprehension is, that the "context" ("CurrentSession") is mixed through the seperate instances, so that in the external method which is invoke from "UserA" in "CurrentSession" the identity from "UserB" is.
In https://github.com/zyanfx/Zyan/blob/master/source/Zyan.Communication/ServerSession.cs i have read by "CurrentSession" "This property doesn't cross application domain boundaries.". Are each Session in his own app-domain?

Thanks in advance
csharpdeveloper12

Can an object returned by a service still be hooked into Zyan?

Hi!

This is a question about how to use Zyan, given this use case where the server can determine what service the client would get based on the parameter it sent in (serviceType):

// Pseudo code for the main service handler IServices
public interface IServices
{
     IClientServiceHandle GetServiceHandle(string serviceType);
     // the server will create a concrete class of IClientServiceHandle and return this
}

delegate void MessageReceivedEventHandler(string message);
public interface IClientServiceHandle : IDisposable
{
     event MessageReceivedEventHandler MessageReceived;
     void Close();
}

What I want is for the handler object returned by GetServiceHandle(...) to still be connected via Zyan, so that the server can Invoke the MessageReceived event on it's side which would then trigger the MessageReceived event on the client side. From my tests, it seems that the object returned to the client side is disconnected from the server side and thus won't receive the event.

As an example (fictional), let's say the serviceType was "HourlyAlarm":

  • the server will invoke MessageReceived on a timer at the hourly interval
  • the client continues receiving such messages until closed/disposed

Q1): Is what I'm trying to achieve at all possible using Zyan?

Q2): If this design can be made to work, will it be possible that the server can also call close/dispose (e.g. when the server is shutdown) and that state is reflected by the client?

Timeline for release 2.11

Hi yallie,

are you planning the release of the version 2.11?

The implementation of SRP-6a is verry great and i would like to use it via NuGet.

Thank you and many greetings.

heikar

Codeplex is archived. So where are the forums now?

Hi,

I actually wanted to asked a question about how to use Zyan with Named Pipes, but I couldn't find the forums to post this question (the English forum link seemed to go to Codeplex, and Codeplex is now only an archive/readonly).

Kind Regards,
E.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.