Basic test component (disco Info)

This commit is contained in:
Mickael Remond
2018-01-14 16:54:12 +01:00
parent ceeb51ce0e
commit ff2da776d3
2 changed files with 57 additions and 4 deletions

View File

@@ -94,6 +94,13 @@ func (c *Component) ReadPacket() (Packet, error) {
return next(c.decoder)
}
func (c *Component) Send(packet string) error {
if _, err := fmt.Fprintf(c.conn, packet); err != nil {
return errors.New("cannot send packet " + err.Error())
}
return nil
}
// ============================================================================
// Handshake Packet