[PD1] Structured client.

Still need to create crypto object and use it to encrypt messages
Need to create TLS still
This commit is contained in:
Afonso Franco 2024-04-17 15:44:38 +01:00
parent 278b8e1a73
commit cdaae8fb7e
Signed by: afonso
SSH key fingerprint: SHA256:aiLbdlPwXKJS5wMnghdtod0SPy8imZjlVvCyUX9DJNk
9 changed files with 252 additions and 110 deletions

View file

@ -0,0 +1,16 @@
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}
}