- This topic has 11 replies, 2 voices, and was last updated 11 years, 2 months ago by Anonymous.
-
AuthorPosts
-
September 17, 2013 at 19:01 #1070AnonymousInactive
I am really struggling with this library, the ClientServerExample project does not work “The requested address is not valid in its context”.
I must admit I find the layout of the project a little unusual for a TCP library. I would be expecting to see something like:
Server server = new TcpServer(connection);
server.dataIn += …etcLooks like its got some cool features, like PB, but for now I just need something simple that works in winforms, to get started with.
September 17, 2013 at 19:09 #1071AnonymousInactiveHeya,
“The requested address is not valid in its context” – This means you are probably providing an invalid IP address for the remote end. Try running two instances of the example on the local machine and use the loop back address 127.0.0.1
I must admit I find the layout of the project a little unusual for a TCP library. I would be expecting to see something like:
Server server = new TcpServer(connection);
server.dataIn += …etcThis approach would significantly complicate the more advanced features. The approach used by NetworkComms attempts to simplify the connection relationship and the best way to think of everything is a peer to peer connection, rather than a strict client/server relationship.
I can confirm the clientServerExample project (completed downloadable example) does work at my end. Please confirm your usage here to locate the issue.
Regards,
MarcSeptember 17, 2013 at 20:16 #1072AnonymousInactiveI’m just running the example builds and they both crash. It doesn’t matter that I set the address to 127.0.0.1.
September 17, 2013 at 20:25 #1073AnonymousInactiveI’ll help as much as I can to get you up and running. Could you please give me some more information about your environment. OS, .net verison, are you building from visual studio and then running the .exe, etc. Run me through the process from download to running that causes the crash.
Regards,
MarcSeptember 17, 2013 at 20:38 #1074AnonymousInactiveWindows 8.0.
Building in VS2010 express.I download the zip file called ClientServerExample.zip, unzip and then try to run the prebuilt exes. I also compile the source code to run. I touch nothing with the source code.
Error in client:
Error during TCP connection establish with destination ([TCP] Local -> 127.0.0.1:10000). Destination may not be listening or connect timed out. System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:10000
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.TcpClient.EndConnect(IAsyncResult asyncResult)
at NetworkCommsDotNet.TCPConnection.ConnectTCPClient()Error occurs at:
NetworkComms.SendObject(“Message”, serverIP, serverPort, messageToSend);Error in Server:
The requested address is not valid in its context
Error occurs at:
TCPConnection.StartListening(true);September 17, 2013 at 21:13 #1075AnonymousInactivePlease prevent visual studio from breaking on exception notifications, see Debug > Exceptions, and run again.
Marc
September 17, 2013 at 21:20 #1076AnonymousInactiveI went to CLR exceptions, unchecked User Unhandled.
The result is the same.September 17, 2013 at 23:24 #1077AnonymousInactiveUntick the ‘thrown’ coloumn for CLR Exceptions, the user-unhandled should remain ticked.
September 17, 2013 at 23:33 #1078AnonymousInactiveThats been unchecked but no difference.
September 18, 2013 at 09:49 #1079AnonymousInactiveGoing back over what you have written the client error makes sense, if the server cannot start correctly the client has nothing to connect too.
As to why the server is having problems I’m not currently sure why. You are the first person in several thousand to have such a problem. What I would like you to try is replace the following line in the client source:
//Start listening for incoming connections TCPConnection.StartListening(true);
with
//This will force NetworkComms to only listen on adaptors //with an ip's matching 127.*.*.* NetworkComms.AllowedIPPrefixes = new string[] { "127" }; //Start listening for incoming connections TCPConnection.StartListening(true);
Then rebuild, check the “created on” time of the executable to make sure you are executing the new version.
Marc
-
AuthorPosts
- You must be logged in to reply to this topic.