github.com/ava-labs/avalanchego@v1.11.11/proto/net/conn/conn.proto (about) 1 syntax = "proto3"; 2 3 package net.conn; 4 5 import "google/protobuf/empty.proto"; 6 7 option go_package = "github.com/ava-labs/avalanchego/proto/pb/net/conn"; 8 9 // Conn is a net.Conn see: https://pkg.go.dev/net#Conn 10 service Conn { 11 // Read reads data from the connection. 12 rpc Read(ReadRequest) returns (ReadResponse); 13 // Write writes data to the connection. 14 rpc Write(WriteRequest) returns (WriteResponse); 15 // Close closes the connection. 16 rpc Close(google.protobuf.Empty) returns (google.protobuf.Empty); 17 // SetDeadline sets the read and write deadlines associated 18 // with the connection. 19 rpc SetDeadline(SetDeadlineRequest) returns (google.protobuf.Empty); 20 // SetReadDeadline sets the deadline for future Read calls 21 // and any currently-blocked Read call. 22 rpc SetReadDeadline(SetDeadlineRequest) returns (google.protobuf.Empty); 23 // SetWriteDeadline sets the deadline for future Write calls 24 // and any currently-blocked Write call. 25 rpc SetWriteDeadline(SetDeadlineRequest) returns (google.protobuf.Empty); 26 } 27 28 message ReadRequest { 29 // length of the request in bytes 30 int32 length = 1; 31 } 32 33 message ReadResponse { 34 // read is the payload in bytes 35 bytes read = 1; 36 // error is an error message 37 optional string error = 2; 38 } 39 40 message WriteRequest { 41 // payload is the write request in bytes 42 bytes payload = 1; 43 } 44 45 message WriteResponse { 46 // length of the response in bytes 47 int32 length = 1; 48 // error is an error message 49 optional string error = 2; 50 } 51 52 message SetDeadlineRequest { 53 // time represents an instant in time in bytes 54 bytes time = 1; 55 }