MCPcopy Create free account
hub / github.com/apache/brpc / StreamWrite

Function StreamWrite

src/brpc/stream.cpp:782–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780}
781
782int StreamWrite(StreamId stream_id, const butil::IOBuf &message,
783 const StreamWriteOptions* options) {
784 SocketUniquePtr ptr;
785 if (Socket::Address(stream_id, &ptr) != 0) {
786 return EINVAL;
787 }
788 Stream* s = (Stream*)ptr->conn();
789 const int rc = s->AppendIfNotFull(message, options);
790 if (rc == 0) {
791 return 0;
792 }
793 return (rc == 1) ? EAGAIN : errno;
794}
795
796void StreamWait(StreamId stream_id, const timespec *due_time,
797 void (*on_writable)(StreamId, void*, int), void *arg) {

Callers 7

mainFunction · 0.85
mainFunction · 0.85
on_received_messagesMethod · 0.85
TEST_FFunction · 0.85
on_received_messagesMethod · 0.85
actionMethod · 0.85

Calls 1

AppendIfNotFullMethod · 0.80

Tested by 4

TEST_FFunction · 0.68
on_received_messagesMethod · 0.68
actionMethod · 0.68