MCPcopy Create free account
hub / github.com/Cyinx/einx / Write

Method Write

network/tcp_transport.go:46–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46func (t *tcpTransport) Write() bool {
47 tcp_conn := t.conn
48 write_queue := t.write_queue
49 msg_list := make([]interface{}, 16)
50 for {
51 c := write_queue.Get(msg_list, 16)
52 for i := uint32(0); i < c; i++ {
53 write_msg := msg_list[i].(*WriteWrapper)
54 if write_msg == nil {
55 goto write_close
56 }
57 if t.WriteMsgPacket(tcp_conn, write_msg) == false {
58 goto write_close
59 }
60 msg_list[i] = nil
61 write_msg.reset()
62 write_pool.Put(write_msg)
63 }
64 }
65write_close:
66 buf := t.write_buf
67 t.write_buf = nil
68 buffer_pool.Put(buf)
69 return false
70}
71
72func (t *tcpTransport) WriteMsgPacket(conn net.Conn, msg *WriteWrapper) bool {
73 switch msg.msg_type {

Callers 4

WriteMsgPacketMethod · 0.80
RunMethod · 0.80
writeFileMethod · 0.80
writeStdMethod · 0.80

Calls 4

WriteMsgPacketMethod · 0.95
GetMethod · 0.65
resetMethod · 0.45
PutMethod · 0.45

Tested by

no test coverage detected