Fatal Exception using SmppClient in ASP.NET web app

Smpp v3.4 client

Moderator: alt

Locked
ceezed
Posts: 13
Joined: Wed Oct 29, 2008 1:08 pm

Fatal Exception using SmppClient in ASP.NET web app

Post by ceezed » Fri Nov 21, 2008 3:07 am

Here is the error details as reported in Event Viewer:
-------------------------------------------------------------

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/Root/XXXXXX

Process ID: 1212

Exception: System.Net.Sockets.SocketException

Message: A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call

StackTrace: at System.Net.Sockets.Socket.BeginSend(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, AsyncCallback callback, Object state)
at ALT.SMS.SmppClient.euCxoGiBO(IPacket )
at ALT.SMS.SmppClient.EXm2LxyTH(MemoryStream& )
at ALT.SMS.SmppClient.gyUVBwlit(IAsyncResult )
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Net.ContextAwareResult.CompleteCallback(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

For more information, see Help and Support Center at
ceezed
Posts: 13
Joined: Wed Oct 29, 2008 1:08 pm

Post by ceezed » Fri Nov 21, 2008 3:50 am

Can I suggest you put a try/catch in SendPacket()?
alt
Site Admin
Posts: 988
Joined: Tue Apr 25, 2006 9:45 am

Post by alt » Fri Nov 21, 2008 2:39 pm

try catch added in the version 2.5.4.

Thank you for you suggestion.
Locked