You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: session.go
    path of file: ./repos/cellnet/peer/udp
    
    the code of the file until where you have to start completion: package udp

import (
	"github.com/davyxu/cellnet"
	"github.com/davyxu/cellnet/peer"
	"net"
	"sy
    
func (self *udpSession) WriteData(data []byte) {

	c := self.Conn()
	if c == nil {
		return
	}

	// Connector中的Session
	if self.remote == nil {

		c.Write(data)

		// Acceptor中的Session
	} else {
		c.WriteToUDP(data, self.remote)
	}
}