linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] Getting error on message receive function (C#) - M


From: Vijay Chauhan
Subject: [Linphone-developers] Getting error on message receive function (C#) - Memory read exception
Date: Fri, 16 Oct 2015 17:59:16 +0530

Hi,

We are creating a c# binding using linphone-latest-sdk, but in message_received 
handler we are getting following error.

Exception:

System.AccessViolationException was unhandled
  HResult=-2147467261
  Message=Attempted to read or write protected memory. This is often an 
indication that other memory is corrupt.
  Source=mscorlib
  StackTrace:
       at Microsoft.Win32.Win32Native.CoTaskMemFree(IntPtr ptr)
       at System.StubHelpers.CSTRMarshaler.ClearNative(IntPtr pNative)
       at sipdotnet.Linphone.linphone_address_get_username(IntPtr add)
       at sipdotnet.Linphone.MessageReceived(IntPtr lc, IntPtr room, IntPtr 
message) in d:\Projects\sipdotnet\sipdotnet\Linphone.cs:line 430
       at sipdotnet.Linphone.linphone_core_iterate(IntPtr lc)
       at sipdotnet.Linphone.<LinphoneStart>b__a(Object sender, 
ElapsedEventArgs e) in d:\Projects\sipdotnet\sipdotnet\Linphone.cs:line 613
       at System.Timers.Timer.MyTimerCallback(Object state)
       at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext 
executionContext, ContextCallback callback, Object state, Boolean 
preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext 
executionContext, ContextCallback callback, Object state, Boolean 
preserveSyncCtx)
       at System.Threading.TimerQueueTimer.CallCallback()
       at System.Threading.TimerQueueTimer.Fire()
       at System.Threading.TimerQueue.FireNextTimers()
       at System.Threading.TimerQueue.AppDomainTimerCallback()
  InnerException: 

Please refer the following code snippet for the reference.  

Code:

// function refrence to message_received
void MessageReceived(IntPtr lc, IntPtr room, IntPtr message)
{
 IntPtr add = linphone_chat_room_get_peer_address(room);

 // Here, we getting above mentioned exception
 string strName = linphone_address_get_username(add);

 string strMessage = linphone_chat_message_get_text(message);
}

Also, we are frequently getting the same error while calling 
linphone_core_iterate after setting the proxiy config to linphone core.

Can you please help me to fix this issue? 

Thanks in advance.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]