Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

View file

@ -0,0 +1,5 @@
local(net) = net_tcp
#net->connect('127.0.0.1',256)
#net->dowithclose => {
#net->writestring('Hello World')
}

View file

@ -0,0 +1,6 @@
import net
var s = newSocket()
s.connect("localhost", Port(256))
s.send("Hello Socket World")
s.close()

View file

@ -0,0 +1,40 @@
Load "guilib.ring"
new qApp {
oClient = new Client { client() }
exec()
}
Class Client
win1 oTcpSocket
func client
win1 = new qwidget()
new qpushbutton(win1) {
setgeometry(50,50,100,30)
settext("connect")
setclickevent("oClient.Connect()")
}
win1 {
setwindowtitle("client")
setgeometry(10,100,400,400)
show()
}
func connect
oTcpSocket = new qTcpSocket(win1) {
setconnectedevent("oClient.pConnected()")
connecttohost("127.0.0.1",256,3,0)
waitforconnected(5000)
}
func pConnected
cStr = "hello socket world"
write(cStr,len(cStr))
flush()
waitforbyteswritten(300000)
close()

View file

@ -0,0 +1,8 @@
var host = Socket.gethostbyname('localhost');
var in = Socket.sockaddr_in(256, host);
var proto = Socket.getprotobyname('tcp');
var sock = Socket.open(Socket.AF_INET, Socket.SOCK_STREAM, proto);
sock.connect(in);
sock.send('hello socket world', 0, in);
sock.close;

View file

@ -0,0 +1,4 @@
'127.0.0.1' $addr
connect $addr 256 sok
'hello socket world' [sok]
close sok