Forum Replies Created
-
AuthorPosts
-
MarcFKeymaster
For pure speed, if you are sending small objects you want to use something along these lines:
//Change default send receive options to remove compression
NetworkComms.DefaultSendReceiveOptions = new SendReceiveOptions<ProtobufSerializer>();//Create the connection
Connection newConnection = UDPConnection.GetConnection(new ConnectionInfo(“192.168.0.1”, 10000), UDPOptions.None);
newConnection.SendObject(“packetName”, “This is the information I want to send!”);Here we are just sending a string but you might also want to send small structs or classes containing the necessary information. For an example on how to send custom objects checkout the AdvancedSend example in the ExamplesConsole project. You’ll have to download the source zip bundle for that.
Regards,
MarcFKeymasterHeya Marc,
Many thanks for your interest in NetworkComms.Net. One of the great things about the library is that it does all of the network/connection management for you. For example if you would like a TCP connection to the ip address 192.168.0.1 on port 10000 you simply retrieve it using:
Connection newConnection = TCPConnection.GetConnection(new ConnectionInfo(“192.168.0.1”, 10000));
The advantage of this approach is that should the connection already exist, regardless where you try to use the connection via TCPConnection.GetConnection() you get the existing connection. If the connection does not already exist then it is created for you. A good demonstration of this usage can be found the in the WPF chat example tutorial, https://networkcomms.net/creating-a-wpf-chat-client-server-application/.
Once you have the connection you can then send as you mention using newConnection.SendObject() etc.
We have had some issues with version 2.1 in unity3d but please download the current alpha version of v2.2 using this temporary link https://networkcomms.net/downloads/NetworkCommsDotNetCompleteDLL_Net2_v2.2.0-Alpha.zip.
If you have any other problems please let us know,
Regards,
MarcMarcFKeymasterScratch that, after some further testing there are still issues. It runs successfully and outputs ‘some’ logging data but for some reason it does not seem to log everything. This appears to be a problem with the nlog framework as the comms code executes without issue. I’ll try to get in touch with the NLog guys and see if we can work out what the problem is.
MarcFKeymasterok, this has been completely fixed. It will be part of the v2.2 release (hopefully within the next week). If you would like another alpha copy before then let me know.
Regards,
MarcMarcFKeymasterWe have a working fix that allows NetworkComms.Net to work correctly in unity but at the loss of any logging functionality. We are continuing work to make logging available as soon as possible but I may end up requiring some changes to NLog. If you want the current fix please let us know.
MarcFKeymasterThat would make sense. The error is caused during the initialisation of comms which happens before logging is disabled/enabled. It is possible to prevent the error from happening by manually removing the logging functionality but we are ‘today’ looking for an alternative which would allow the logging to be used with unity.
MarcFKeymasterInteresting error. As far as we were aware people had been using the v2.2 alpha successfully in unity 3d. I’ll see if one of the developers can look at this in the next couple of days.
In the mean time if you find a solution please let us know.
Regards,
MarcMarcFKeymasterGreat to hear. Let us know if you have any further problems.
MarcFKeymasterOk, so the error is being thrown when it tries to load the assembly.
It is possible that the error message is caused by a couple of things:
1. The loading executable may be having issues because of the .net version. I have emailed you a link to a .net2 build which we will be releasing soon as part of version 2.2. We are still testing this version so there may still be bugs.
2. The loading executable may be struggling with the complete DLL. The complete DLL is actually multiple DLL’s merged into one. This works on every platform we have tested to date but it might be worth trying the individual DLLs as well. The easiest way to do that is to download the source zip bundle and copy all DLLs from the build folder of the ExamplesConsole project into your own. You will then have to add references for each DLL seperately.
If you try both of those things and still have problems let me know.
MarcFKeymasterHeya edugargollo,
Many thanks for your interest in NetworkComms. We’ll definitely help in any way we can.
To get start it would help to know if this is an error you receive on execution or on compilation?
Regards,
Marc -
AuthorPosts