[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:
parent
278b8e1a73
commit
cdaae8fb7e
9 changed files with 252 additions and 110 deletions
16
Projs/PD1/internal/utils/networking/client.go
Normal file
16
Projs/PD1/internal/utils/networking/client.go
Normal 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}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue