123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278 |
- .class Lokhttp3/mockwebserver/MockWebServer$2;
- .super Lokhttp3/internal/NamedRunnable;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/EnclosingMethod;
- value = Lokhttp3/mockwebserver/MockWebServer;->start(Ljava/net/InetSocketAddress;)V
- .end annotation
- .annotation system Ldalvik/annotation/InnerClass;
- accessFlags = 0x0
- name = null
- .end annotation
- # instance fields
- .field final synthetic this$0:Lokhttp3/mockwebserver/MockWebServer;
- # direct methods
- .method varargs constructor <init>(Lokhttp3/mockwebserver/MockWebServer;Ljava/lang/String;[Ljava/lang/Object;)V
- .locals 0
- iput-object p1, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-direct {p0, p2, p3}, Lokhttp3/internal/NamedRunnable;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V
- return-void
- .end method
- .method private acceptConnections()V
- .locals 4
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/lang/Exception;
- }
- .end annotation
- :goto_0
- :try_start_0
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$100(Lokhttp3/mockwebserver/MockWebServer;)Ljava/net/ServerSocket;
- move-result-object v0
- invoke-virtual {v0}, Ljava/net/ServerSocket;->accept()Ljava/net/Socket;
- move-result-object v0
- :try_end_0
- .catch Ljava/net/SocketException; {:try_start_0 .. :try_end_0} :catch_0
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/mockwebserver/Dispatcher;->peek()Lokhttp3/mockwebserver/MockResponse;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/mockwebserver/MockResponse;->getSocketPolicy()Lokhttp3/mockwebserver/SocketPolicy;
- move-result-object v1
- sget-object v2, Lokhttp3/mockwebserver/SocketPolicy;->DISCONNECT_AT_START:Lokhttp3/mockwebserver/SocketPolicy;
- if-ne v1, v2, :cond_0
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- const/4 v2, 0x0
- invoke-static {v1, v2, v0}, Lokhttp3/mockwebserver/MockWebServer;->access$600(Lokhttp3/mockwebserver/MockWebServer;ILjava/net/Socket;)V
- invoke-virtual {v0}, Ljava/net/Socket;->close()V
- goto :goto_0
- :cond_0
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v1}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v1
- invoke-interface {v1, v0}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
- iget-object v1, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v1, v0}, Lokhttp3/mockwebserver/MockWebServer;->access$700(Lokhttp3/mockwebserver/MockWebServer;Ljava/net/Socket;)V
- goto :goto_0
- :catch_0
- move-exception v0
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object v1
- new-instance v2, Ljava/lang/StringBuilder;
- invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
- iget-object v3, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v3, " done accepting connections: "
- invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/net/SocketException;->getMessage()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-virtual {v1, v0}, Ljava/util/logging/Logger;->info(Ljava/lang/String;)V
- return-void
- .end method
- # virtual methods
- .method protected execute()V
- .locals 5
- :try_start_0
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object v0
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- iget-object v2, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v2, " starting to accept connections"
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v1
- invoke-virtual {v0, v1}, Ljava/util/logging/Logger;->info(Ljava/lang/String;)V
- invoke-direct {p0}, Lokhttp3/mockwebserver/MockWebServer$2;->acceptConnections()V
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- goto :goto_0
- :catchall_0
- move-exception v0
- invoke-static {}, Lokhttp3/mockwebserver/MockWebServer;->access$000()Ljava/util/logging/Logger;
- move-result-object v1
- sget-object v2, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level;
- new-instance v3, Ljava/lang/StringBuilder;
- invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
- iget-object v4, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- const-string v4, " failed unexpectedly"
- invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v3
- invoke-virtual {v1, v2, v3, v0}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
- :goto_0
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$100(Lokhttp3/mockwebserver/MockWebServer;)Ljava/net/ServerSocket;
- move-result-object v0
- invoke-static {v0}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/ServerSocket;)V
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$200(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v0
- invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
- move-result-object v0
- :goto_1
- invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
- move-result v1
- if-eqz v1, :cond_0
- invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v1
- check-cast v1, Ljava/net/Socket;
- invoke-static {v1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V
- invoke-interface {v0}, Ljava/util/Iterator;->remove()V
- goto :goto_1
- :cond_0
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$300(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/Set;
- move-result-object v0
- invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
- move-result-object v0
- :goto_2
- invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
- move-result v1
- if-eqz v1, :cond_1
- invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v1
- check-cast v1, Ljava/io/Closeable;
- invoke-static {v1}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V
- invoke-interface {v0}, Ljava/util/Iterator;->remove()V
- goto :goto_2
- :cond_1
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$400(Lokhttp3/mockwebserver/MockWebServer;)Lokhttp3/mockwebserver/Dispatcher;
- move-result-object v0
- invoke-virtual {v0}, Lokhttp3/mockwebserver/Dispatcher;->shutdown()V
- iget-object v0, p0, Lokhttp3/mockwebserver/MockWebServer$2;->this$0:Lokhttp3/mockwebserver/MockWebServer;
- invoke-static {v0}, Lokhttp3/mockwebserver/MockWebServer;->access$500(Lokhttp3/mockwebserver/MockWebServer;)Ljava/util/concurrent/ExecutorService;
- move-result-object v0
- invoke-interface {v0}, Ljava/util/concurrent/ExecutorService;->shutdown()V
- return-void
- .end method
|