Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for writeClose (0.09 sec)

  1. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

            "b4495fb4376",
        )
      }
    
      @Test fun serverEmptyClose() {
        serverWriter.writeClose(0, null)
        assertData("8800")
      }
    
      @Test fun serverCloseWithCode() {
        serverWriter.writeClose(1001, null)
        assertData("880203e9")
      }
    
      @Test fun serverCloseWithCodeAndReason() {
        serverWriter.writeClose(1001, "Hello".encodeUtf8())
        assertData("880703e948656c6c6f")
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketWriter.kt

       *     [Section 7.4 of RFC 6455](http://tools.ietf.org/html/rfc6455#section-7.4) or `0`.
       * @param reason Reason for shutting down or `null`.
       */
      @Throws(IOException::class)
      fun writeClose(
        code: Int,
        reason: ByteString?,
      ) {
        var payload = ByteString.EMPTY
        if (code != 0 || reason != null) {
          if (code != 0) {
            validateCloseCode(code)
          }
          payload =
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/ws/RealWebSocket.kt

            synchronized(this) {
              queueSize -= message.data.size.toLong()
            }
          } else if (messageOrClose is Close) {
            val close = messageOrClose as Close
            writer!!.writeClose(close.code, close.reason)
    
            // We closed the writer: now both reader and writer are closed.
            if (streamsToClose != null) {
              listener.onClosed(this, receivedCloseCode, receivedCloseReason!!)
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 22.1K bytes
    - Viewed (0)
  4. internal/ioutil/ioutil.go

    type DeadlineWriter struct {
    	io.WriteCloser
    	timeout time.Duration
    	err     error
    }
    
    // NewDeadlineWriter wraps a writer to make it respect given deadline
    // value per Write(). If there is a blocking write, the returned Writer
    // will return whenever the timer hits (the return values are n=0
    // and err=context.DeadlineExceeded.)
    func NewDeadlineWriter(w io.WriteCloser, timeout time.Duration) io.WriteCloser {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Jul 26 12:55:01 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  5. internal/ringbuffer/ring_buffer.go

    	r.isFull = false
    }
    
    // WriteCloser returns a WriteCloser that writes to the ring buffer.
    // When the returned WriteCloser is closed, it will wait for all data to be read before returning.
    func (r *RingBuffer) WriteCloser() io.WriteCloser {
    	return &writeCloser{RingBuffer: r}
    }
    
    type writeCloser struct {
    	*RingBuffer
    }
    
    // Close provides a close method for the WriteCloser.
    func (wc *writeCloser) Close() error {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed May 15 00:11:04 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  6. internal/logger/logrotate.go

    	if err != nil {
    		return err
    	}
    	defer r.Close()
    
    	gw, err := os.Create(oldLgFile + ".gz")
    	if err != nil {
    		return err
    	}
    	defer gw.Close()
    
    	var wc io.WriteCloser
    	wc = gzip.NewWriter(gw)
    	if _, err = io.Copy(wc, r); err != nil {
    		return err
    	}
    
    	if err = wc.Close(); err != nil {
    		return err
    	}
    
    	// Persist to disk any caches.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5.8K bytes
    - Viewed (0)
  7. cmd/bitrot-streaming.go

    	"github.com/minio/minio/internal/ioutil"
    	"github.com/minio/minio/internal/ringbuffer"
    )
    
    // Calculates bitrot in chunks and writes the hash into the stream.
    type streamingBitrotWriter struct {
    	iow          io.WriteCloser
    	closeWithErr func(err error)
    	h            hash.Hash
    	shardSize    int64
    	canClose     *sync.WaitGroup
    	byteBuf      []byte
    }
    
    func (b *streamingBitrotWriter) Write(p []byte) (int, error) {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 21 12:20:54 UTC 2024
    - 6K bytes
    - Viewed (0)
  8. cmd/bitrot-whole.go

    }
    
    func (b *wholeBitrotWriter) Close() error {
    	return nil
    }
    
    // Returns whole-file bitrot writer.
    func newWholeBitrotWriter(disk StorageAPI, volume, filePath string, algo BitrotAlgorithm, shardSize int64) io.WriteCloser {
    	return &wholeBitrotWriter{disk, volume, filePath, shardSize, algo.New()}
    }
    
    // Implementation to verify bitrot for the whole file.
    type wholeBitrotReader struct {
    	disk       StorageAPI
    	volume     string
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Jan 31 02:11:45 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  9. cmd/object-api-datatypes.go

    	UserTags string
    
    	// List of individual parts, maximum size of upto 10,000
    	Parts []ObjectPartInfo `json:"-"`
    
    	// Implements writer and reader used by CopyObject API
    	Writer       io.WriteCloser `json:"-" msg:"-"`
    	Reader       *hash.Reader   `json:"-" msg:"-"`
    	PutObjReader *PutObjReader  `json:"-" msg:"-"`
    
    	metadataOnly bool
    	versionOnly  bool // adds a new version, only used by CopyObject
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jun 10 15:31:51 UTC 2024
    - 20.9K bytes
    - Viewed (0)
  10. cmd/server-main.go

    			addrs.Add(globalMinioAddr)
    		}
    	} else {
    		addrs.Add(globalMinioAddr)
    	}
    	return addrs.ToSlice()
    }
    
    var globalLoggerOutput io.WriteCloser
    
    func initializeLogRotate(ctx *cli.Context) (io.WriteCloser, error) {
    	lgDir := ctx.String("log-dir")
    	if lgDir == "" {
    		return os.Stderr, nil
    	}
    	lgDirAbs, err := filepath.Abs(lgDir)
    	if err != nil {
    		return nil, err
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Sep 24 21:50:11 UTC 2024
    - 35.2K bytes
    - Viewed (1)
Back to top