Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for ServerSocket (0.07 sec)

  1. okhttp/src/test/java/okhttp3/internal/UtilTest.kt

      @Test
      fun socketIsHealthy() {
        val localhost = InetAddress.getLoopbackAddress()
        val serverSocket = ServerSocket(0, 1, localhost)
    
        val socket = Socket()
        socket.connect(serverSocket.localSocketAddress)
        val socketSource = socket.source().buffer()
    
        assertThat(socket.isHealthy(socketSource)).isTrue()
    
        serverSocket.close()
        assertThat(socket.isHealthy(socketSource)).isFalse()
      }
    
      @Test
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 3K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/SocksProxy.kt

      private var serverSocket: ServerSocket? = null
      private val connectionCount = AtomicInteger()
      private val openSockets = Collections.newSetFromMap(ConcurrentHashMap<Socket, Boolean>())
    
      fun play() {
        serverSocket = ServerSocket(0)
        executor.execute {
          val threadName = "SocksProxy ${serverSocket!!.localPort}"
          Thread.currentThread().name = threadName
          try {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 22:09:35 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/DelegatingServerSocketFactory.kt

      @Throws(IOException::class)
      override fun createServerSocket(): ServerSocket {
        val serverSocket = delegate.createServerSocket()
        return configureServerSocket(serverSocket)
      }
    
      @Throws(IOException::class)
      override fun createServerSocket(port: Int): ServerSocket {
        val serverSocket = delegate.createServerSocket(port)
        return configureServerSocket(serverSocket)
      }
    
      @Throws(IOException::class)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 2K bytes
    - Viewed (0)
  4. okhttp-tls/src/test/java/okhttp3/tls/HandshakeCertificatesTest.kt

      private lateinit var executorService: ExecutorService
    
      private var serverSocket: ServerSocket? = null
    
      @BeforeEach fun setUp() {
        executorService = Executors.newCachedThreadPool(threadFactory("HandshakeCertificatesTest"))
      }
    
      @AfterEach fun tearDown() {
        executorService.shutdown()
        serverSocket?.closeQuietly()
      }
    
      @Test fun clientAndServer() {
        platform.assumeNotConscrypt()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 22:09:35 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/http/ThreadInterruptTest.kt

          object : DelegatingServerSocketFactory(getDefault()) {
            @Throws(SocketException::class)
            override fun configureServerSocket(serverSocket: ServerSocket): ServerSocket {
              serverSocket.setReceiveBufferSize(SOCKET_BUFFER_SIZE)
              return serverSocket
            }
          }
        client =
          clientTestRule.newClientBuilder()
            .socketFactory(
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  6. guava/src/com/google/common/base/FinalizableReferenceQueue.java

     *
     *   private final ServerSocket serverSocket;
     *
     *   private MyServer(...) {
     *     ...
     *     this.serverSocket = new ServerSocket(...);
     *     ...
     *   }
     *
     *   public static MyServer create(...) {
     *     MyServer myServer = new MyServer(...);
     *     final ServerSocket serverSocket = myServer.serverSocket;
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Thu Jul 11 20:51:36 UTC 2024
    - 13.1K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http/CancelTest.kt

          object : DelegatingServerSocketFactory(ServerSocketFactory.getDefault()) {
            @Throws(IOException::class)
            override fun configureServerSocket(serverSocket: ServerSocket): ServerSocket {
              serverSocket.receiveBufferSize = SOCKET_BUFFER_SIZE
              return serverSocket
            }
          }
        if (connectionType != HTTP) {
          server.useHttps(handshakeCertificates.sslSocketFactory())
        }
        server.start()
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Jan 20 10:30:28 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  8. mockwebserver/src/test/java/mockwebserver3/internal/http2/Http2Server.kt

      private val sslSocketFactory: SSLSocketFactory,
    ) : Http2Connection.Listener() {
      private fun run() {
        val serverSocket = ServerSocket(8888)
        serverSocket.reuseAddress = true
        while (true) {
          var socket: Socket? = null
          try {
            socket = serverSocket.accept()
            val sslSocket = doSsl(socket)
            val protocolString = Platform.get().getSelectedProtocol(sslSocket)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

        return writer
      }
    
      fun takeFrame(): InFrame = inFrames.take()
    
      fun play() {
        check(serverSocket == null)
        serverSocket = ServerSocket()
        serverSocket!!.reuseAddress = false
        serverSocket!!.bind(InetSocketAddress("localhost", 0), 1)
        port = serverSocket!!.localPort
        executor.execute {
          try {
            readAndWriteFrames()
          } catch (e: IOException) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 11 22:09:35 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  10. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

        started = true
    
        this._inetSocketAddress = inetSocketAddress
    
        serverSocket = serverSocketFactory!!.createServerSocket()
    
        // Reuse if the user specified a port
        serverSocket!!.reuseAddress = inetSocketAddress.port != 0
        serverSocket!!.bind(inetSocketAddress, 50)
    
        portField = serverSocket!!.localPort
    
        taskRunner.newQueue().execute("MockWebServer $portField", cancelable = false) {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 37.4K bytes
    - Viewed (0)
Back to top