Skip to content

Commit

Permalink
example
Browse files Browse the repository at this point in the history
  • Loading branch information
bas1c1 authored Feb 28, 2023
1 parent f5233d8 commit 0779ceb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/server.gs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use "std"
use "socket"

ip_addr_fam = socket_ip_create("0.0.0.0", 8888)
using (socket = new_socket(ADDR_FAMILY_INTNET, SOCKSTREAM, TCP_PROTOCOL)) {
socket_bind(socket, ip_addr_fam)
socket_listen(socket, 1000)
client = socket_accept(socket)
print(socket_get_socket(client))
}

stop()

0 comments on commit 0779ceb

Please sign in to comment.