func (socket *Socket) Write(data string) error {
	if socket.Closed {
		return io.EOF
	}

	// write data
	_, err := socket.conn.Write([]byte(data))
	if err != nil {
		socket.Close()
		return err
	}
	return nil
}
// Write sends the given string out of Socket.
Write sends the given string out of Socket.
// Write sends the given string out of Socket .
func (socket *Socket) Write(data string) error {
	if socket.Closed {
		return io.EOF
	}
	_, err := socket.conn.Write([]byte(data))
	if err != nil {
		socket.Close()
		return err
	}
	return nil
}
func ( socket * Socket ) Write ( data string ) error { if socket . Closed { return io . EOF } _ , err := socket . conn . Write ( [ ] byte ( data ) ) if err != nil { socket . Close ( ) return err } return nil }
Write sends the given string out of Socket.
Write sends the given string out of Socket .
// write data