Http2Connection$Builder.smali 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. .class public Lokhttp3/internal/http2/Http2Connection$Builder;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # annotations
  5. .annotation system Ldalvik/annotation/EnclosingClass;
  6. value = Lokhttp3/internal/http2/Http2Connection;
  7. .end annotation
  8. .annotation system Ldalvik/annotation/InnerClass;
  9. accessFlags = 0x9
  10. name = "Builder"
  11. .end annotation
  12. # instance fields
  13. .field client:Z
  14. .field hostname:Ljava/lang/String;
  15. .field listener:Lokhttp3/internal/http2/Http2Connection$Listener;
  16. .field pushObserver:Lokhttp3/internal/http2/PushObserver;
  17. .field sink:Lokio/BufferedSink;
  18. .field socket:Ljava/net/Socket;
  19. .field source:Lokio/BufferedSource;
  20. # direct methods
  21. .method public constructor <init>(Z)V
  22. .locals 1
  23. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  24. sget-object v0, Lokhttp3/internal/http2/Http2Connection$Listener;->REFUSE_INCOMING_STREAMS:Lokhttp3/internal/http2/Http2Connection$Listener;
  25. iput-object v0, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->listener:Lokhttp3/internal/http2/Http2Connection$Listener;
  26. sget-object v0, Lokhttp3/internal/http2/PushObserver;->CANCEL:Lokhttp3/internal/http2/PushObserver;
  27. iput-object v0, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->pushObserver:Lokhttp3/internal/http2/PushObserver;
  28. iput-boolean p1, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->client:Z
  29. return-void
  30. .end method
  31. # virtual methods
  32. .method public build()Lokhttp3/internal/http2/Http2Connection;
  33. .locals 1
  34. new-instance v0, Lokhttp3/internal/http2/Http2Connection;
  35. invoke-direct {v0, p0}, Lokhttp3/internal/http2/Http2Connection;-><init>(Lokhttp3/internal/http2/Http2Connection$Builder;)V
  36. return-object v0
  37. .end method
  38. .method public listener(Lokhttp3/internal/http2/Http2Connection$Listener;)Lokhttp3/internal/http2/Http2Connection$Builder;
  39. .locals 0
  40. iput-object p1, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->listener:Lokhttp3/internal/http2/Http2Connection$Listener;
  41. return-object p0
  42. .end method
  43. .method public pushObserver(Lokhttp3/internal/http2/PushObserver;)Lokhttp3/internal/http2/Http2Connection$Builder;
  44. .locals 0
  45. iput-object p1, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->pushObserver:Lokhttp3/internal/http2/PushObserver;
  46. return-object p0
  47. .end method
  48. .method public socket(Ljava/net/Socket;)Lokhttp3/internal/http2/Http2Connection$Builder;
  49. .locals 3
  50. .annotation system Ldalvik/annotation/Throws;
  51. value = {
  52. Ljava/io/IOException;
  53. }
  54. .end annotation
  55. invoke-virtual {p1}, Ljava/net/Socket;->getRemoteSocketAddress()Ljava/net/SocketAddress;
  56. move-result-object v0
  57. check-cast v0, Ljava/net/InetSocketAddress;
  58. invoke-virtual {v0}, Ljava/net/InetSocketAddress;->getHostName()Ljava/lang/String;
  59. move-result-object v0
  60. invoke-static {p1}, Lokio/Okio;->source(Ljava/net/Socket;)Lokio/Source;
  61. move-result-object v1
  62. invoke-static {v1}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
  63. move-result-object v1
  64. invoke-static {p1}, Lokio/Okio;->sink(Ljava/net/Socket;)Lokio/Sink;
  65. move-result-object v2
  66. invoke-static {v2}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink;
  67. move-result-object v2
  68. invoke-virtual {p0, p1, v0, v1, v2}, Lokhttp3/internal/http2/Http2Connection$Builder;->socket(Ljava/net/Socket;Ljava/lang/String;Lokio/BufferedSource;Lokio/BufferedSink;)Lokhttp3/internal/http2/Http2Connection$Builder;
  69. move-result-object p1
  70. return-object p1
  71. .end method
  72. .method public socket(Ljava/net/Socket;Ljava/lang/String;Lokio/BufferedSource;Lokio/BufferedSink;)Lokhttp3/internal/http2/Http2Connection$Builder;
  73. .locals 0
  74. iput-object p1, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->socket:Ljava/net/Socket;
  75. iput-object p2, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->hostname:Ljava/lang/String;
  76. iput-object p3, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->source:Lokio/BufferedSource;
  77. iput-object p4, p0, Lokhttp3/internal/http2/Http2Connection$Builder;->sink:Lokio/BufferedSink;
  78. return-object p0
  79. .end method