- This topic has 18 replies, 6 voices, and was last updated 11 years, 4 months ago by Anonymous.
-
AuthorPosts
-
August 7, 2013 at 11:44 #1023AnonymousInactive
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.
August 7, 2013 at 12:01 #1024AnonymousInactiveI 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.August 7, 2013 at 12:34 #1025AnonymousInactiveHeloo MarcF,
The IP address of my physical machines is @ IP: 193.51.91.5:10000
Thank you.
August 8, 2013 at 00:15 #1026AnonymousInactiveHeloo MarcF,
I await your response thank you
because I’m stuck for 20 days in this problem ..
Thank youAugust 12, 2013 at 12:04 #1032AnonymousInactiveFirst 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.
August 12, 2013 at 15:31 #1033AnonymousInactiveHello. 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
MaxAugust 12, 2013 at 16:27 #1034AnonymousInactiveThere 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.
August 12, 2013 at 18:55 #1035AnonymousInactiveThanks for pointing me this.
Greetings,
MaxAugust 14, 2013 at 16:43 #1041AnonymousInactiveTo 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.
-
AuthorPosts
- You must be logged in to reply to this topic.