-
Notifications
You must be signed in to change notification settings - Fork 1
/
main3.go
37 lines (30 loc) · 893 Bytes
/
main3.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
package main
//发送40字节的head试试
import (
"fmt"
"github.com/aloxc/goice/ice"
)
func main3() {
//hello.sayHello(string) 测试成功
//request := ice.NewIceRequest(ice.NewIdentity("HelloIce",""),ice.OperatorModeNormal,"sayHello","aaa")
//result := request.DoRequest()
//fmt.Println("请求结果",string(result))
//Goice.sayHi()无參及
context := make(map[string]string)
context["name"] = "aloxc"
//func NewIceRequest(name string, mode OperationMode, operator string, context map[string]string, params interface{}) *IceRequest {
request := ice.NewIceRequest("HelloIce", ice.OperatorModeNormal, "sayHi", nil, "")
result, err := request.DoRequest(ice.ResponseType_String)
reError1(err)
fmt.Println("请求结果", result)
}
func reError1(err error) {
if err == nil {
switch err.(type) {
case *ice.UserUnknownError:
break
default:
panic(err)
}
}
}