-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
36 lines (32 loc) · 838 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
package main
import (
"fmt"
"time"
"github.com/forget-the-bright/go-dde/dde"
. "github.com/forget-the-bright/go-dde/types"
)
func runClient() {
ddecli := dde.DdeClient{}
ddecli.AppName = "Server"
ddecli.TopicName = "MyTopic"
ddecli.Items = []VString{"MyItem0", "MyItem1", "MyItem2", "MyItem3", "MyItem4", "MyItem5", "MyItem6"}
ddecli.Run()
for i := 0; i < len(ddecli.Items); i++ {
data := ddecli.Request(ddecli.HszItem[i])
fmt.Printf("data: %v\n", data)
ddecli.Poke(ddecli.HszItem[i], data)
time.Sleep(1e9)
}
}
func runServer() {
ddeser := dde.DdeServer{}
ddeser.AppName = "Server"
ddeser.TopicName = "MyTopic"
ddeser.Items = []VString{"MyItem0", "MyItem1", "MyItem2", "MyItem3", "MyItem4", "MyItem5", "MyItem6"}
//defer ddeser.DestoryServer()
ddeser.RunServer()
}
func main() {
//runClient()
runServer()
}