FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
protomq/src/main.zig at main · electricalgorithm/protomq · GitHub
electricalgorithm
/
protomq
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
36
Code
Issues
1
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
protomq
/
src
/
main.zig
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (21 loc) · 836 Bytes
Breadcrumbs
protomq
/
src
/
main.zig
Copy path
File metadata and controls
27 lines (21 loc) · 836 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
const
std
=
@import
(
"std"
);
const
TcpServer
=
@import
(
"server/tcp.zig"
).
TcpServer
;
const
types
=
@import
(
"common/types.zig"
);
/// Entry point for the MQTT server
pub
fn
main
()
!
void
{
var
gpa
=
std
.
heap
.
GeneralPurposeAllocator
(.{}){};
defer
_
=
gpa
.
deinit
();
const
allocator
=
gpa
.
allocator
();
std
.
debug
.
print
(
"ProtoMQ Server Starting...
\n
"
, .{});
std
.
debug
.
print
(
"Version: 0.2.0
\n
"
, .{});
std
.
debug
.
print
(
"Zig Version: {s}
\n\n
"
, .{
@import
(
"builtin"
).
zig_version_string
});
// Create and start TCP server
var
server
=
try
TcpServer
.
init
(
allocator
,
types
.
DEFAULT_HOST
,
types
.
DEFAULT_PORT
);
defer
server
.
deinit
();
// Run the server (this blocks)
try
server
.
run
();
std
.
debug
.
print
(
"
\n
✓ Server stopped cleanly
\n
"
, .{});
}
test
"basic sanity test"
{
try
std
.
testing
.
expect
(
true
);
}
Back
|
FazBrowse Home
|
New Git URL