Home Forums Support Send file with progress and stats

Viewing 9 posts - 11 through 19 (of 19 total)
  • Author
    Posts
  • #1023
    Anonymous
    Inactive

    Is that with both applications running simultaneously? If so then there is an error in your network configuration of virtual machine which we are unable to help with here. You need to ensure the virtual machine is using a bridged network adapter and should get an IP of 192.51.91.X where X is not the same as the physical machine.

    #1024
    Anonymous
    Inactive

    I apologize because I’m in the wrong address this virtual machine @ Ip: 192.168.56.1:10000 and for me the problem:
    * Creation of a new Client 2 code located in a virtual machine (virtual box under wiondows 7) and @ IP address: 192.168.56.1:10000.
    * The server connects to the client 2 (sends a message with Method “SendMsg : Heloo 2”.
    * Client 2 answer to the server a message “Thank you”.
    Thank you.

    #1025
    Anonymous
    Inactive

    Heloo MarcF,

    The IP address of my physical machines is @ IP: 193.51.91.5:10000

    Thank you.

    #1026
    Anonymous
    Inactive

    Heloo MarcF,

    I await your response thank you
    because I’m stuck for 20 days in this problem ..
    Thank you

    #1032
    Anonymous
    Inactive

    First of all apologies for the delay. I’m just going to state a couple of assumptions I’m making before I diagnose this issue (it does however look like an issue in your networking configuration so we might not be able to help much)

    You have a physical machine (server) and a virtual machine (client2)

    server is trying to connect to client2 (note this is a little odd as normally clients connect to a server)

    server is trying to send on 193.51.91.5:10000 which is a public ip address

    client2 is trying to receive on 192.168.56.1:10000 which is a private network ip address

    If all this is correct then there is no way that the server can know where to find client2 as it does not know “where” this private network is. client2 could however connect to server as the server ip is public. For server to connect to client2 they have to be on the same subnet, in other words you need to make sure that the server has an ip address in the 192.168.56.x range. The type of network used here depends on the virtual machine system you are using, in virtualbox for example it is called a “Host-only network. If you let me know the virtual machine environment you are using I may be able to point you in the right direction.

    Hopefully this makes things a bit more understandable. If any of my assumptions above were wrong please correct me and I’ll try and help further. It really does however sound like this is a network configuration issue and thus this is probably not the best place to solve your problem.

    #1033
    Anonymous
    Inactive

    Hello. Starting from this:

    System.IO.Stream recievedData = new System.IO.MemoryStream();
    NetworkComms.AppendGlobalIncomingPacketHandler<byte[]>("PartitionedSend", (packetHeader, connection, incomingBytes) =>
    {
        Console.WriteLine("\n  ... Incoming data from " + connection.ToString());
        recievedData.Write(incomingBytes, 0, incomingBytes.Length);
    });

    How can I know when all packets have been received ? When the stream is completed I wold to know where to handle the receivedData variable get bytes from the stream.
    THanks
    Max

    #1034
    Anonymous
    Inactive

    There are a couple of ways of achieving that. You could for example, before you start sending the chunks, send a packet just containing the total length of the stream your going to be receiving. Then just keep waiting till that threshold has been reached. Alternatively if you have a fixed chunk size you can wait till you receive a chunk less than the expected size (you’ll then have to check whether at the end you need to send a zero length chunk for the case where the total stream size is an exact multiple of the chunk size). There’s no real advantage/disadvantage to either it just depends on what you’re most comfortable with.

    #1035
    Anonymous
    Inactive

    Thanks for pointing me this.
    Greetings,
    Max

    #1041
    Anonymous
    Inactive

    To add to this, when the sendReceive callback delegate is executed the packet is already completed. A single send is received in a single receive, this is guaranteed.

Viewing 9 posts - 11 through 19 (of 19 total)
  • You must be logged in to reply to this topic.