CSI-ES-2324/Projs/PD1/internal/utils/networking/client.go
afonso cdaae8fb7e
[PD1] Structured client.
Still need to create crypto object and use it to encrypt messages
Need to create TLS still
2024-04-17 15:44:38 +01:00

16 lines
320 B
Go

package networking
import "net"
type Client[T any] struct {
Connection Connection[T]
}
func NewClient[T any]() Client[T] {
dialConn, err := net.Dial("tcp", "localhost:8080")
if err != nil {
panic("Could not open connection to server")
}
conn := NewConnection[T](dialConn)
return Client[T]{Connection: conn}
}