wire.bend
bend-kit-wire@0.4.8.0 · 151 lines · 23 definitions
1
2import Base
3
4
5
6
7
8
9
10
11def connect(host: String, port: U32, ms: U32) ->
12 IO(Result<&1, &1, U32 & String, Socket>):
13 import "./effs/wire.c"
14 import "./effs/wire.js"
15
16
17
18def listen(host: String, port: U32) ->
19 IO(Result<&1, &1, U32 & String, Listener & U32>):
20 import "./effs/wire.c"
21 import "./effs/wire.js"
22
23
24
25
26def accept.deadline(listener: Listener, ms: U32) ->
27 IO(Listener & Result<&1, &1, U32 & String, Socket>):
28 import "./effs/wire.c"
29 import "./effs/wire.js"
30
31
32def recv(sock: Socket, max: U32, ms: U32) ->
33 IO(Socket & Result<&1, &1, U32 & String, String>):
34 import "./effs/wire.c"
35 import "./effs/wire.js"
36
37def send(sock: Socket, data: String) ->
38 IO(Socket & Result<&1, &1, U32 & String, Unit>):
39 import "./effs/wire.c"
40 import "./effs/wire.js"
41
42
43
44def idle(sock: Socket) -> IO(Socket & Bool):
45 import "./effs/wire.c"
46 import "./effs/wire.js"
47
48def recv_from(sock: Socket, max: U32, ms: U32) ->
49 IO(Socket & Result<&1, &1, U32 & String, String & U32 & String>):
50 import "./effs/wire.c"
51 import "./effs/wire.js"
52
53def send_to(sock: Socket, host: String, port: U32, data: String) ->
54 IO(Socket & Result<&1, &1, U32 & String, Unit>):
55 import "./effs/wire.c"
56 import "./effs/wire.js"
57
58
59
60def tls.connect(sock: Socket, host: String, ms: U32) ->
61 IO(Socket & Result<&1, &1, U32 & String, Unit>):
62 import "./effs/wire.c"
63 import "./effs/wire.js"
64
65
66
67def tls.connect.cert(sock: Socket, host: String, ms: U32, cert_path: String, key_path: String) ->
68 IO(Socket & Result<&1, &1, U32 & String, Unit>):
69 import "./effs/wire.c"
70 import "./effs/wire.js"
71
72
73def tls.connect.alpn(sock: Socket, host: String, ms: U32, protos: String) ->
74 IO(Socket & Result<&1, &1, U32 & String, String>):
75 import "./effs/wire.c"
76 import "./effs/wire.js"
77
78
79
80def tls.connect.ca(sock: Socket, host: String, ms: U32, ca_path: String) ->
81 IO(Socket & Result<&1, &1, U32 & String, Unit>):
82 import "./effs/wire.c"
83 import "./effs/wire.js"
84
85
86def tls.connect.alpn.ca(sock: Socket, host: String, ms: U32, protos: String, ca_path: String) ->
87 IO(Socket & Result<&1, &1, U32 & String, String>):
88 import "./effs/wire.c"
89 import "./effs/wire.js"
90
91
92def tls.send(sock: Socket, data: String) ->
93 IO(Socket & Result<&1, &1, U32 & String, Unit>):
94 import "./effs/wire.c"
95 import "./effs/wire.js"
96
97
98def tls.recv(sock: Socket, max: U32, ms: U32) ->
99 IO(Socket & Result<&1, &1, U32 & String, String>):
100 import "./effs/wire.c"
101 import "./effs/wire.js"
102
103
104def tls.close(sock: Socket) -> IO(Unit):
105 import "./effs/wire.c"
106 import "./effs/wire.js"
107
108
109
110def recv.words(sock: Socket, max: U32, ms: U32) ->
111 IO(Socket & Result<&1, &1, U32 & String, U32 & Array<U32>>):
112 import "./effs/wire.c"
113 import "./effs/wire.js"
114
115
116def send.words(sock: Socket, len: U32, words: Array<U32>) ->
117 IO(Socket & Result<&1, &1, U32 & String, Unit>):
118 import "./effs/wire.c"
119 import "./effs/wire.js"
120
121
122
123
124
125def send.words.deadline(sock: Socket, len: U32, words: Array<U32>, ms: U32) ->
126 IO(Socket & (U32 & Result<&1, &1, U32 & String, Unit>)):
127 import "./effs/wire.c"
128 import "./effs/wire.js"
129
130
131def recv_from.words(sock: Socket, max: U32, ms: U32) ->
132 IO(Socket & Result<&1, &1, U32 & String, String & U32 & (U32 & Array<U32>)>):
133 import "./effs/wire.c"
134 import "./effs/wire.js"
135
136
137def send_to.words(sock: Socket, host: String, port: U32, len: U32, words: Array<U32>) ->
138 IO(Socket & Result<&1, &1, U32 & String, Unit>):
139 import "./effs/wire.c"
140 import "./effs/wire.js"
141
142
143def tls.recv.words(sock: Socket, max: U32, ms: U32) ->
144 IO(Socket & Result<&1, &1, U32 & String, U32 & Array<U32>>):
145 import "./effs/wire.c"
146 import "./effs/wire.js"
147
148def tls.send.words(sock: Socket, len: U32, words: Array<U32>) ->
149 IO(Socket & Result<&1, &1, U32 & String, Unit>):
150 import "./effs/wire.c"
151 import "./effs/wire.js"