如何获得Android的TCP跟踪 [英] How to get android tcp trace

查看:162
本文介绍了如何获得Android的TCP跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找的答案,最后问题在报价

这是在响应<一个href=\"http://stackoverflow.com/questions/11847092/android-tcp-does-not-flush-until-socket-is-closed#comment15763190_11847092\">this螺纹:


  

由于这些短消息(小于MSS),我猜堆栈可实现Nagle算法。在服务器做某种类型的延迟ACK的?如果可能的话,你应该捕捉跟踪,并查看是否有从另一个侧面挂起的确认。
  在这两种情况下,TCP_NODELAY应该有所帮助。


  
  

    

      

        

(1)什么是ACK立场?我GOOGLE了它,但无法找到一个定义(2)我会给你和尼古拉提出了一枪,如果它确实回答这个问号回答TCP_NODELAY。感谢您的帮助迄今!


        
        

          

ACK是TCP确认。而不是发送对每个段的ACK,服务器可能正在等待一束它们。如果客户端实现的Nagle的算法中,它会等待一个ACK发送段以&lt之前; MSS。在TCP跟踪,你必须寻找在TCP报头和ACK数它的合作涉及到序列号是否发生这种情况。或者你也可以张贴在这里拍摄的片段。


          
          

            

              

                

                  

                    

好吧,我更新的问题,以显示我的线程的run方法创建插座以及Java服务器。你会看到,我已socketClient.setTcpNoDelay(真);在那里了,但它不是修复它。文档具有它应该是socketClient.setTcpNoDelay(上);但后来我需要初始化上。我有点困惑,我应该初始化什么是上为使socketClient.setTcpNoDelay(上);工作?


                    
                    

在问候了TCP跟踪,办,从机器人(客户端)或计算机(服务器)的一面呢?在哪里/我该如何实现呢?这纯粹是socketClient。 ?


                  
                
              
            
          
        
      
    
  

附加信息:


  • 我在Eclipse开发

  • 我的TCP客户端(安卓)被张贴在链接的问题

  • 我的TCP服务器(JAVA)发布的链接的问题


解决方案

我不知道如果标题涉及你问这个问题。

如果我们坚持的标题:如何获得Android的TCP跟踪,您可以使用的软件如 HTTP:// WWW .wireshark.org /

将其安装在开发机器上,并确保,你的开发设备或仿真器使用您的开发计算机的网络连接。

这是你如何让TCP跟踪最简单的方法(恕我直言)

I am looking for an answer to the last questions in the quote

This is in response to this thread:

Since these are short messages (< MSS), I guess the stack may be implementing Nagle's algorithm. Is the server doing some kind of delayed ACKs? If possible you should capture a trace and see if there are pending acknowledgements from the other side. In either case, TCP_NODELAY should help.

(1) What does ACK stand for? I googled it but couldn't find a definition (2) I will give the TCP_NODELAY that you and Nikolai suggested a shot and mark answered if it does indeed answer the question. Thanks for the help so far!

ACK is tcp acknowledgement. Instead of sending an ACK for each segment, the server may be waiting to bunch them. If the client implements Nagle's algo, it'd be waiting for an ACK before it sends segments with < MSS. In a TCP trace, you'll have to look for an ACK number in the TCP header and co-relate it to the SEQ number to see if this is happening. Or you can post a snippet of the capture here.

Ok, I updated the question to show the run method in my thread that creates the socket as well as the Java server. You will see that I had socketClient.setTcpNoDelay(true); in there already, but it wasn't fixing it. The documentation has that it should be socketClient.setTcpNoDelay(on); but then I need to initialize on. I am a bit perplexed as to what I should initialize "on" as to make socketClient.setTcpNoDelay(on); work?

in regards to the TCP trace, do I do that from android (client) or computer (server) side? and where/how do I implement that? would it just be socketClient. ?

Additional Info:

  • I am developing in Eclipse
  • My TCP client (android) is posted in the linked question
  • My TCP server (java) is posted in the linked question

解决方案

I'm not sure if the headline relates to the question you're asking.

If we stick to the headline: "How to get android tcp trace" you can use software like http://www.wireshark.org/.

Install it on your development machine and make sure, your dev device or emulator uses the internet connection of your dev machine.

this is how you get the tcp trace the easiest way (imho)

这篇关于如何获得Android的TCP跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆