Home Forums Support Sending CustomObject from client application to Server application fails.

  • This topic has 4 replies, 2 voices, and was last updated 11 years ago by Anonymous.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1173
    Anonymous
    Inactive

    Hi,

    I am able to send integer, string and List type data from server application to client application but when I am trying to send CustomObject from my server application to client application it fails with the exception provided below at the end of the email.

    I think I am getting the exception because of not doing proper serialization.

    I saw your AdvancedSend.cs class but could not understand.

    Could you please provide me a simple sample that sends CustomObject
    from a server application to client application using ‘BinaryFormaterSerializer’ in C#.

    {NetworkCommsDotNet.ExpectedReturnTimeoutException: Timeout occurred after 10000ms waiting for response packet of type ‘CustomObjectReply’.
    at NetworkCommsDotNet.Connection.SendReceiveObject[returnObjectType](String sendingPacketTypeStr, String expectedReturnPacketTypeStr, Int32 returnPacketTimeOutMilliSeconds, Object sendObject, SendReceiveOptions sendOptions, SendReceiveOptions receiveOptions, Int64& sentPacketSequenceNumber)
    at NetworkCommsDotNet.Connection.SendReceiveObject[returnObjectType](String sendingPacketTypeStr, String expectedReturnPacketTypeStr, Int32 returnPacketTimeOutMilliSeconds, Object sendObject, SendReceiveOptions sendOptions, SendReceiveOptions receiveOptions)
    at NetworkCommsDotNet.Connection.SendReceiveObject[returnObjectType](String sendingPacketTypeStr, String expectedReturnPacketTypeStr, Int32 returnPacketTimeOutMilliSeconds)
    at ClientApplication.Program.Main(String[] args) in c:\Users\Ahmed\Desktop\Network\ClientServerExample\ClientApplication\Program.cs:line 54}

    Thank You,
    -Ahmed.

    #1174
    Anonymous
    Inactive

    Hi,

    Now I am able to send customObject from server application to client application when that customObject class is declared in both client and server.
    But actually what I am trying to do is, I have a class library where I have my classes (serialized) declared and I access those classes in client application and server application by having a reference of that library. When I am trying to send these class objects from server to client I am getting the exception “NetworkCommsDotNet.ExpectedReturnTimeoutException”.

    Is it possible to achieve this by using NetworkComms.Net ?
    If possible can you please tell me how to achieve this.

    Thank You,
    -Ahmed

    #1179
    Anonymous
    Inactive

    Yes, this is possible. Please see the following tutorial, here.

    If you are receiving ExpectedReturnTimeoutException’s please look for error log files in the client and server.

    Regards,
    Marc

    #1186
    Anonymous
    Inactive

    Hi Marc,

    Thanks for your reply.

    Presently we are using ‘Genuine Channels’ Remoting Library and we are evaluating .Net Network Library from NetworkComms.Net to replace Genuine Channels.

    We built our framework some what similar to the below description.

    We have separate Client and Server application solutions.

    Both Client and Server application reference a class library(.dll) which consists of an interface name ‘IAgent.cs’ .
    A method name ‘GetCustomerDetails(customerId)’ is declared in ‘IAgent.cs’ interface.

    The Server application has got the method implementation of ‘IAgent.cs’ interface in ‘Agent.cs’ class.

    Now I have to get the object of ‘Agent.cs’ class at Client side so that I can invoke the method ‘GetCustomerDetails(customerId)’ with this object reference and get the details on client side.

    I have gone through AdvancedSend.cs but I did not find anything related to my requirement. Moreover there is no use of ‘SendReceiveObject’ there.

    Could you please provide me an example demonstrating ‘SendReceiveObject’ or an example meeting the above described requirement.

    #1187
    Anonymous
    Inactive

    Checkout the included remote procedure call example (RPCExample.cs).

    Regards,
    Marc

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.