Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:10:17+00:00 2026-06-15T18:10:17+00:00

I have an application that communicate through sockets using the *Async methods (like SendAsync

  • 0

I have an application that communicate through sockets using the *Async methods (like SendAsync). I’m getting this strange behavior where SendAsync is executed but the data is not sent over the wire.

I’ve enabled network tracing and got the following log:

System.Net.Sockets Verbose: 0 : [4300] Socket#5024928::SendAsync()
System.Net.Sockets Verbose: 0 : [4300] Socket#5024928::SendAsync(Boolean#1)
System.Net.Sockets Verbose: 0 : [7320] Data from Socket#5024928::FinishOperation(SendAsync)
System.Net.Sockets Verbose: 0 : [7320] 00000E8C : 01 99 27 00 00 00 01 00-00 00 00 00 00 00 00 00 : ..'.............
System.Net.Sockets Verbose: 0 : [7320] 00000E9C : 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 : ................
System.Net.Sockets Verbose: 0 : [7320] 00000EAC : 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 : ................
System.Net.Sockets Verbose: 0 : [7320] 00000EBC : 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 : ................
System.Net.Sockets Verbose: 0 : [7320] 00000ECC : 00 00 B3 F4                                     : ....
System.Net.Sockets Verbose: 0 : [7320] Socket#5024928::ReceiveAsync()
System.Net.Sockets Verbose: 0 : [7320] Exiting Socket#5024928::ReceiveAsync()   -> Boolean#1
System.Net.Sockets Error: 0 : [7320] Socket#5024928::UpdateStatusAfterSocketError() - TimedOut

Although the trace shows that the data was sent (and a receive timeout occurred), the data was not really sent. I’ve checked with Microsoft’s Network Monitor and there’s no log of this data being sent.

The send method is pretty straightfoward:

 public void Send(AsyncClientState state, byte[] data) {
            var socket = state.Socket;
            var dataTransferredEventArgs = new DataTransferredEventArgs(data, _maxBytes) { State = state };
            state.Events.RaiseBeforeSend(dataTransferredEventArgs);
            byte[] bytesToSend = dataTransferredEventArgs.Bytes.ToArray();
            SocketAsyncEventArgs args = GetSocketAsyncEventArgsArgs(socket, bytesToSend.Length);
            if (args == null) {
                state.Events.RaiseTimeout(Operation.Send);
                return;
            }
            args.Completed += SendCompleted;
            args.UserToken = state;
            Buffer.BlockCopy(bytesToSend, 0, args.Buffer, args.Offset, bytesToSend.Length);
            bool sendAsync = socket.SendAsync(args);
            if (!sendAsync) {
                SendCompleted(this, args);
            }
        }

        private void SendCompleted(object sender, SocketAsyncEventArgs e) {
            var state = (AsyncClientState) e.UserToken;
            var events = state.Events;
            try {
                if (e.SocketError != SocketError.Success) {
                    events.RaiseError(new ErrorEventArgs("(SendSocketError)" + e.SocketError));
                    return;
                }
                if (e.LastOperation == SocketAsyncOperation.Send) {
                    e.Completed -= SendCompleted;
                    _asyncEventArgsPool.PutBack(e);
                    events.RaiseAfterSend(new StateEventArgs(state));
                }
            }
            catch (ObjectDisposedException) { }
            catch (SocketException ex) {
                events.RaiseError(new ErrorEventArgs(string.Format("{0}: {1}", ex.SocketErrorCode, ex.Message)));
            }
        }

Am I missing something here? Is the network tracing really reliable?

UPDATE

I tried to use Begin/End*, but still the same problem. Here is the trace:

System.Net.Sockets Verbose: 0 : [6632] Socket#29357909::BeginSend()
System.Net.Sockets Verbose: 0 : [6632] Exiting Socket#29357909::BeginSend()     -> OverlappedAsyncResult#30136159
System.Net.Sockets Verbose: 0 : [6500] Data from Socket#29357909::PostCompletion
System.Net.Sockets Verbose: 0 : [6500] 00000000 : 01 99 27 00 00 00 01 00-00 00 00 00 00 00 00 00 : ..'.............
System.Net.Sockets Verbose: 0 : [6500] 00000010 : 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 : ................
System.Net.Sockets Verbose: 0 : [6500] 00000020 : 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 : ................
System.Net.Sockets Verbose: 0 : [6500] 00000030 : 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 : ................
System.Net.Sockets Verbose: 0 : [6500] 00000040 : 00 00 B3 F4                                     : ....
System.Net.Sockets Verbose: 0 : [6500] Socket#29357909::EndSend(OverlappedAsyncResult#30136159)
System.Net.Sockets Verbose: 0 : [6500] Exiting Socket#29357909::EndSend()   -> Int32#68
System.Net.Sockets Verbose: 0 : [6500] Socket#29357909::BeginReceive()
System.Net.Sockets Verbose: 0 : [6500] Exiting Socket#29357909::BeginReceive()  -> OverlappedAsyncResult#63504289
System.Net.Sockets Verbose: 0 : [6500] Socket#29357909::EndReceive(OverlappedAsyncResult#63504289)
System.Net.Sockets Error: 0 : [6500] Socket#29357909::UpdateStatusAfterSocketError() - TimedOut
System.Net.Sockets Error: 0 : [6500] Exception in Socket#29357909::EndReceive - A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond.
System.Net.Sockets Verbose: 0 : [6500] Exiting Socket#29357909::EndReceive()    -> Int32#0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:10:18+00:00Added an answer on June 15, 2026 at 6:10 pm

    After talking to our network administrator, we found that the problem was a network misconfiguration. I’m not “into” networking but the problem was related to the fact that the equipment I was communicating were into our DMZ.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small application that uses WCF to communicate with a webserver. This
I have a web application that communicates to a WCF service through a WCF
I have WPF C# application that communicate with a PLC (i.e. write/read Omron PLC's
I have an application that uses rest to communicate to a server, i would
i have a java game app that uses sockets to communicate with each other.
I have a java application that stores some GPS data in a strange format:
Our customer has asked that our application be able to communicate through HTTPS. The
I have a TCP based Netty application with multiple clients that need to communicate
I am using Flex Builder 3 to develop my first application that will communicate
I have a windows service and a winform application that communicate between each other

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.