Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
5
Task/Sockets/Lasso/sockets.lasso
Normal file
5
Task/Sockets/Lasso/sockets.lasso
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
local(net) = net_tcp
|
||||
#net->connect('127.0.0.1',256)
|
||||
#net->dowithclose => {
|
||||
#net->writestring('Hello World')
|
||||
}
|
||||
6
Task/Sockets/Nim/sockets.nim
Normal file
6
Task/Sockets/Nim/sockets.nim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import net
|
||||
|
||||
var s = newSocket()
|
||||
s.connect("localhost", Port(256))
|
||||
s.send("Hello Socket World")
|
||||
s.close()
|
||||
40
Task/Sockets/Ring/sockets.ring
Normal file
40
Task/Sockets/Ring/sockets.ring
Normal 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()
|
||||
8
Task/Sockets/Sidef/sockets.sidef
Normal file
8
Task/Sockets/Sidef/sockets.sidef
Normal 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;
|
||||
4
Task/Sockets/Symsyn/sockets.symsyn
Normal file
4
Task/Sockets/Symsyn/sockets.symsyn
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
'127.0.0.1' $addr
|
||||
connect $addr 256 sok
|
||||
'hello socket world' [sok]
|
||||
close sok
|
||||
Loading…
Add table
Add a link
Reference in a new issue