if I have multiple clients connected to a tcp server and I wish to write
back to specific connections I can record the net.Conn value and then use
the Write method on it...but when using Println I get the following for two
clients...
&{{0xc000094000}}
&{{0xc000094080}}
which when testing with a simple write doesn't work...
package main
import "net"
var c net.Conn = "&{{0xc000094000}}"
func writeConn(c net.Conn) {
c.Write([]byte(string("Hello\n")))
}
func main() {
writeConn(c)
}
...and results in the following...
cannot use "&{{0xc000094000}}" (type string) as type net.Conn in assignment
clearly using Println to output the net.Conn is not a viable var to use so
how could I do this ? I intend to record each users net.Conn in a database
which can then be queried as required.
any help would be most greatly appreciated.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/9d93a9b7-fd81-4586-adbb-be6b3996e727n%40googlegroups.com.