-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
45 lines (38 loc) · 804 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"fmt"
"time"
"os"
//server client communication
structure "go/tcp/carrozzino/structure"
server "go/tcp/carrozzino/server"
client "go/tcp/carrozzino/client"
//cert and key creation
creation "go/tcp/carrozzino/creation"
)
func main() {
if true {
var client_generator structure.ClientGenerator =
&creation.Gen{}
client_generator.CreateKey();
client_generator.CreateCSR();
client_generator.CreateCRT();
}
go func() {
time.Sleep(2 * time.Second)
err := client.SendFile()
if err != nil {
fmt.Println(err)
os.Exit(-1)
}
time.Sleep(2 * time.Second)
err = client.SendFile()
if err != nil {
fmt.Println(err)
os.Exit(-1)
}
}()
var server_iterface structure.ServerInterface =
&server.Server{}
server_iterface.Start()
}