Menu

KiBERMiKE

Help
KiBERMiKE
2006-03-13
2013-03-08
  • KiBERMiKE

    KiBERMiKE - 2006-03-13

    Simple program...
    First Application have TCPServer. Second Application have TCPClient. Start Debug. Start Server and Client on localhost.
    On CONNECT - all OK. But! When my Client DISCONECT from my Server (or Server shutdown), then take ERROR:
    @System.AccessViolationException was unhandled
      Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
      Source="System"
      StackTrace:
           at System.Net.UnsafeNclNativeMethods.OSSOCK.WSAGetOverlappedResult(SafeCloseSocket socketHandle, IntPtr overlapped, UInt32& bytesTransferred, Boolean wait, IntPtr ignored)
           at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
           at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)...

    PLEASE, help...

     
    • KiBERMiKE

      KiBERMiKE - 2006-03-13

      Message for this error: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

       
    • Mike Tyler

      Mike Tyler - 2006-03-13

      The error you found is really strange.

      Could you please confirm that you are using .NET 2.0 to build the TCPComponents.NET and its sample applications?

      Kind regards,
      Mike

       
    • KiBERMiKE

      KiBERMiKE - 2006-03-14

      I using MS Visual Studio 2005 C# + .NET 2.0. Default options. This ERROR show up also if i using your sample applications...

       
    • Mike Tyler

      Mike Tyler - 2006-03-14

      Let's try something else:

      1- Try to build the *whole* project (including the demos) as Release and not Debug.
      2- Try to run the TCP client and server demos and see if you have the same errors.

      Note: I believe the errors should be gone since the try/catch statements should prevent them. Please, let me know the results you get up to this point.

       
    • Mike Tyler

      Mike Tyler - 2006-03-14

      Just one more thing. After building the *whole* project (including the demos) as Release, please run the TCP client and server demos outside VS.

       
    • KiBERMiKE

      KiBERMiKE - 2006-03-14

      I run the TCP client and server demos outside VS. Result - Windows Error MessageBox (Ошибка приложения : Инструкция по адресу "0x20b0d0d9" обратилась к памяти по адресу "0x00000000". Память не может быть "written".) - I used Russian Windows XP SP2... After MessageBox Server is close....

       
    • Mike Tyler

      Mike Tyler - 2006-03-14

      I really would like to help you. But I can't find a way to force this error in any of my computers.

      I tried it on Windows XP and 2000. I even created another tcp client to connect and disconnect from the tcp server 1.000 times and got no error.

      The only thing I still did not do is to build the whole package in VS 2005. I am using Visual C# 2005 Express. I will get VS 2005 at work soon. Then I will make more tests.

      Sorry for the inconvenience. I will continue trying and when I find the solution I will update the package.

      Please, let me know if you find a solution (or if you can isolate the problem).

      Kind regards,
      Mike

       
    • KiBERMiKE

      KiBERMiKE - 2006-05-02

      And.... How progress?

       
    • Gabriel Reiser

      Gabriel Reiser - 2006-05-13

      KiBERMiKE,  This is an error that is called when trying to read/write to a stream/socket when the stream/socket doesn't exist.  Error catch using Try Catch and wrap that with an If statement.

      The if statement to see if the socket/stream is be read/written is
      objNetworkStream.CanRead = True

      CanRead and CanWrite return a bool value that you can check to see if the client is connected (or if you have been disconnected from the server).
      If this check returns false, log out because the stream or socket has been closed.

      Hope this helps

       
    • KiBERMiKE

      KiBERMiKE - 2006-05-25

      Are You complete the component?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.