github.com/vmware/transport-go@v1.3.4/stompserver/raw_connection.go (about)

     1  // Copyright 2019-2020 VMware, Inc.
     2  // SPDX-License-Identifier: BSD-2-Clause
     3  
     4  package stompserver
     5  
     6  import (
     7  	"github.com/go-stomp/stomp/v3/frame"
     8  	"time"
     9  )
    10  
    11  type RawConnection interface {
    12  	// Reads a single frame object
    13  	ReadFrame() (*frame.Frame, error)
    14  	// Sends a single frame object
    15  	WriteFrame(frame *frame.Frame) error
    16  	// Set deadline for reading frames
    17  	SetReadDeadline(t time.Time)
    18  	// Close the connection
    19  	Close() error
    20  }
    21  
    22  type RawConnectionListener interface {
    23  	// Blocks until a new RawConnection is established.
    24  	Accept() (RawConnection, error)
    25  	// Stops the connection listener.
    26  	Close() error
    27  }