Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for newStream (0.22 sec)

  1. okhttp/src/test/java/okhttp3/internal/http2/Http2ConnectionTest.kt

        peer.acceptFrame() // DATA STREAM 3
        peer.play()
    
        // Play it back.
        val connection = connect(peer)
        val stream1 = connection.newStream(headerEntries("a", "android"), true)
        val stream2 = connection.newStream(headerEntries("b", "banana"), true)
        connection.writePingAndAwaitPong() // Ensure the GO_AWAY that resets stream2 has been received.
        val sink1 = stream1.getSink().buffer()
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 75.4K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Connection.kt

        check(!client) { "Client cannot push requests." }
        return newStream(associatedStreamId, requestHeaders, out)
      }
    
      /**
       * Returns a new locally-initiated stream.
       *
       * @param out true to create an output stream that we can use to send data to the remote peer.
       *     Corresponds to `FLAG_FIN`.
       */
      @Throws(IOException::class)
      fun newStream(
        requestHeaders: List<Header>,
        out: Boolean,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 32.6K bytes
    - Viewed (0)
  3. internal/grid/grid_test.go

    			t.Fatalf("Unexpected error: %v, %T", err, err)
    		}
    		// Streams should not be able to set up until registered.
    		// Thus, the error is a local error.
    		_, err = remoteConn.NewStream(context.Background(), handlerTest, []byte(testPayload))
    		if !errors.Is(err, ErrUnknownHandler) {
    			t.Fatalf("Unexpected error: %v, %T", err, err)
    		}
    	})
    }
    
    func TestSingleRoundtripGenerics(t *testing.T) {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 08 18:15:27 GMT 2024
    - 30.1K bytes
    - Viewed (0)
  4. internal/grid/README.md

        })
    ```
    
    Sample call:
    ```go
        // Get a connection to the remote host
        conn := manager.Connection(host).Subroute("asubroute")
    	
        payload := []byte("request")
        stream, err := conn.NewStream(ctx, grid.HandlerDiskInfo, payload)
    	if err != nil {
            return err
        }
        // Read results from the stream
        err = stream.Results(func(result []byte) error {
    Plain Text
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 9.4K bytes
    - Viewed (0)
  5. internal/grid/handlers.go

    	sharedResponse bool
    }
    
    // NewStream creates a typed handler that can provide Marshal/Unmarshal.
    // Use Register to register a server handler.
    // Use Call to initiate a clientside call.
    // newPayload can be nil. In that case payloads will always be nil.
    // newReq can be nil. In that case no input stream is expected and the handler will be called with nil 'in' channel.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26.9K bytes
    - Viewed (0)
  6. internal/grid/benchmark_test.go

    					if conn == nil {
    						b.Fatal("No connection")
    					}
    					ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
    					// Send the payload.
    					t := time.Now()
    					st, err := conn.NewStream(ctx, handlerTest, payload)
    					if err != nil {
    						if debugReqs {
    							fmt.Println(err.Error())
    						}
    						b.Fatal(err.Error())
    					}
    					got := 0
    					err = st.Results(func(b []byte) error {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 12.2K bytes
    - Viewed (0)
  7. internal/grid/connection_test.go

    	<-gotCall
    	remote.debugMsg(debugKillInbound)
    	local.debugMsg(debugKillInbound)
    	<-gotResp
    
    	// Must reconnect
    	errFatal(remoteConn.WaitForConnect(context.Background()))
    
    	stream, err := remoteConn.NewStream(context.Background(), handlerTest2, []byte(testPayload))
    	errFatal(err)
    	go func() {
    		for resp := range stream.responses {
    			t.Log("Resp:", resp, err)
    		}
    		gotResp <- struct{}{}
    	}()
    
    	<-gotCall
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 6K bytes
    - Viewed (0)
  8. cmd/metacache-walk.go

    	// Ensure remote has the same disk ID.
    	opts.DiskID = *client.diskID.Load()
    	b, err := opts.MarshalMsg(grid.GetByteBuffer()[:0])
    	if err != nil {
    		return toStorageErr(err)
    	}
    
    	st, err := client.gridConn.NewStream(ctx, grid.HandlerWalkDir, b)
    	if err != nil {
    		return toStorageErr(err)
    	}
    	return toStorageErr(st.Results(func(in []byte) error {
    		_, err := wr.Write(in)
    		return err
    	}))
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 15 08:25:46 GMT 2024
    - 12.4K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2ExchangeCodec.kt

      override fun writeRequestHeaders(request: Request) {
        if (stream != null) return
    
        val hasRequestBody = request.body != null
        val requestHeaders = http2HeadersList(request)
        stream = http2Connection.newStream(requestHeaders, hasRequestBody)
        // We may have been asked to cancel while creating the new stream and sending the request
        // headers, but there was still no stream to close.
        if (canceled) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  10. internal/grid/connection.go

    		}
    		client.cancelFn(context.Canceled)
    		c.outgoing.Delete(client.MuxID)
    	}()
    	return client.traceRoundtrip(ctx, c.trace, h, req)
    }
    
    // NewStream creates a new stream.
    // Initial payload can be reused by the caller.
    func (c *Connection) NewStream(ctx context.Context, h HandlerID, payload []byte) (st *Stream, err error) {
    	if !h.valid() {
    		return nil, ErrUnknownHandler
    	}
    	if c.State() != StateConnected {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 42.6K bytes
    - Viewed (0)
Back to top