Skip to content
Permalink
Browse files

copas: Add some files that didn't make it in

  • Loading branch information
everrush committed Mar 21, 2020
1 parent f82e1c9 commit f139d6f293066e96b848297fe0e1092a97f667b6
@@ -0,0 +1,30 @@
language: python
sudo: false

env:
- LUA="lua=5.1"
- LUA="lua=5.2"
- LUA="lua=5.3"
- LUA="luajit=2.0"
- LUA="luajit=2.1"

before_install:
- pip install hererocks
- hererocks lua_install -r^ --$LUA
- export PATH=$PATH:$PWD/lua_install/bin # Add directory with all installed binaries to PATH

install:
- luarocks install luasec # optional dependency
- luarocks install luacov
- luarocks install luacov-coveralls

script:
- luarocks make $(ls rockspec/copas-[a-z]* | sort -r | head -n 1) # get latest development rockspec
- make coverage

after_success:
- luacov-coveralls --exclude $TRAVIS_BUILD_DIR/lua_install --exclude tests

branches:
except:
- gh-pages
@@ -0,0 +1,20 @@
# Copas 2.0

[![Build Status](https://travis-ci.org/keplerproject/copas.png?branch=master)](https://travis-ci.org/keplerproject/copas)
[![Coverage Status](https://coveralls.io/repos/github/keplerproject/copas/badge.svg?branch=master)](https://coveralls.io/github/keplerproject/copas?branch=master)

Copas is a dispatcher based on coroutines that can be used for asynchronous networking. For example TCP or UDP based servers. But it also features timers and client support for http(s), ftp and smtp requests.

It uses [LuaSocket](https://github.com/diegonehab/luasocket) as the interface with the TCP/IP stack and [LuaSec](https://github.com/brunoos/luasec) for ssl support.

A server or thread registered with Copas should provide a handler for requests and use Copas socket functions to send the response. Copas loops through requests and invokes the corresponding handlers. For a full implementation of a Copas HTTP server you can refer to [Xavante](http://keplerproject.github.io/xavante/) as an example.

Copas is free software and uses the same license as Lua 5.1 to 5.3 (MIT), and can be downloaded from [its GitHub page](https://github.com/keplerproject/copas).

The easiest way to install Copas is through [LuaRocks](https://luarocks.org/):

```
luarocks install copas
```

For more details see [the documentation](http://keplerproject.github.io/copas/).
@@ -0,0 +1,44 @@
-----BEGIN CERTIFICATE-----
MIIDNTCCAp6gAwIBAgIJAOIlTl6l0XV4MA0GCSqGSIb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4OR+zb5k3Q3XMXrsumJXT/XNPhcQEE8d726Jk6SmE8ik+A+UV
52/mdlyH94VQMlSM
-----END PRIVATE KEY-----
@@ -0,0 +1,13 @@
-----BEGIN CERTIFICATE REQUEST-----
MIIB3jCCAUcCAQAwgZ0xCzAJBgNVBAYTAkJSMRcwFQYDVQQIEw5Fc3Bpcml0byBT
YW50bzEfMB0GA1UEBxMWU2FudG8gQW50b25pbyBkbyBDYW5hYTEYMBYGA1UEChMP
U2FvIFRvbmljbyBMdGRhMScwJQYDVQQLEx5EZXBhcnRtZW50IG9mIENvbXB1dGVy
IFNjaWVuY2UxETAPBgNVBAMTCFNlcnZlciBBMIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQDhZABpEYe3Kk5qphNnFCPyB4S/MulnecEEhDYlhH82KJOF6Fl1Xs2x
cYB+QYMCKrKvN4/0Db8ySoY0FlrmPBm6/DO/0TJR8gFh2tKxsFurFEN/JFO3GDw9
Wxr4SSOhRwpk0VTFrUO9iEdwg2wxqb1CPgDa6Q43GVxpb8NaOXTIGwIDAQABoAAw
DQYJKoZIhvcNAQELBQADgYEA4DL8g24KqIyeMpk4qGOCHOFz0usQvJPVQRHNJ67S
J7AUUgcIJ5ielHg6R+/suOgv8PEqTjloZ775mn8eB3XMOjmNTa0Gs3GPXMxStSqr
BZ3jTlfI9LCuxygOllvngVkxstPhM52RV3KSZgr1qRhniACitLODliBXSKdiAYoY
Jc8=
-----END CERTIFICATE REQUEST-----
@@ -0,0 +1,65 @@
-- tests whether the main loop automatically exits when all work is done

local copas = require("copas")
local socket = require("socket")

local done = false

copas.addthread(function()
for i = 1, 5 do
copas.sleep(0)
print(i)
end

done = true
end)

print("Test 1 count to 5... then exit")
copas.loop()

if done then
print("Test 1 done")
else
print("Loop completed with test 1 not finished")
os.exit(1)
end

done = false
local server = socket.bind("*", 20000)
local message = "Hello world!"

copas.addserver(server, function(skt)
local received = copas.receive(skt)

if received ~= message then
print("Incorrect return from copas.receive: "..tostring(received))
os.exit(1)
else
print("Received "..message)
end

copas.removeserver(server)
done = true
end)

copas.addthread(function()
copas.sleep(1)
local skt = socket.connect("localhost", 20000)
print("Sending "..message.."\\n")
local bytes = copas.send(skt, message.."\n")

if bytes ~= #message + 1 then
print("Incorrect return from copas.send: "..tostring(bytes))
os.exit(1)
end
end)

print("Test 2 send and receive some... then exit")
copas.loop()

if done then
print("Test 2 done")
else
print("Loop completed with test 2 not finished")
os.exit(1)
end

0 comments on commit f139d6f

Please sign in to comment.
You can’t perform that action at this time.