generated from Comet/Comet-C-External-Lib
19 lines
366 B
Plaintext
19 lines
366 B
Plaintext
import socket
|
|
import io
|
|
|
|
func main() -> int {
|
|
socket.Socket s = new socket.Socket(socket.Family.INET, socket.Type.STREAM, 0)
|
|
|
|
s.bind("127.0.0.1", 2000)
|
|
|
|
s.listen(10)
|
|
socket.Socket client = s.accept()
|
|
io.println("Connection received!")
|
|
|
|
string response = client.recv(256)
|
|
io.println("Response: %s", response)
|
|
|
|
s.close()
|
|
|
|
return 0
|
|
} |