epoll

Event-based socket server, which uses epoll

License

License

GroupId

GroupId

com.wizzardo
ArtifactId

ArtifactId

epoll
Last Version

Last Version

0.3.4
Release Date

Release Date

Type

Type

jar
Description

Description

epoll
Event-based socket server, which uses epoll
Project URL

Project URL

https://github.com/wizzardo/epoll
Source Code Management

Source Code Management

https://github.com/wizzardo/epoll

Download epoll

How to add to project

<!-- https://jarcasting.com/artifacts/com.wizzardo/epoll/ -->
<dependency>
    <groupId>com.wizzardo</groupId>
    <artifactId>epoll</artifactId>
    <version>0.3.4</version>
</dependency>
// https://jarcasting.com/artifacts/com.wizzardo/epoll/
implementation 'com.wizzardo:epoll:0.3.4'
// https://jarcasting.com/artifacts/com.wizzardo/epoll/
implementation ("com.wizzardo:epoll:0.3.4")
'com.wizzardo:epoll:jar:0.3.4'
<dependency org="com.wizzardo" name="epoll" rev="0.3.4">
  <artifact name="epoll" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.wizzardo', module='epoll', version='0.3.4')
)
libraryDependencies += "com.wizzardo" % "epoll" % "0.3.4"
[com.wizzardo/epoll "0.3.4"]

Dependencies

compile (2)

Group / Artifact Type Version
com.wizzardo.tools : tools-io jar 0.22
com.wizzardo.tools : tools-reflection jar 0.22

test (2)

Group / Artifact Type Version
junit : junit jar 4.12
com.wizzardo.tools : tools jar 0.22

Project Modules

There are no modules declared in this project.

Epoll

Event-based socket server, which uses epoll

        EpollServer server = new EpollServer(8080) {
            @Override
            protected IOThread createIOThread() {
                return new IOThread() {
                    byte[] buffer = new byte[1024];
                    byte[] data = ("HTTP/1.1 200 OK\r\n" +
                            "Connection: Keep-Alive\r\n" +
                            "Content-Length: 11\r\n" +
                            "Content-Type: text/html;charset=UTF-8\r\n" +
                            "\r\n" +
                            "it's alive!").getBytes();

                    @Override
                    public void onConnect(Connection connection) {
                        System.out.println("new connection!");
                    }

                    @Override
                    public void onDisconnect(Connection connection) {
                        System.out.println("we lost him =(");
                    }

                    @Override
                    public void onRead(Connection connection) {
                        try {
                            int r = connection.read(buffer, 0, buffer.length);
                            System.out.println("request: " + new String(buffer, 0, r));
                            connection.write(data);
                        } catch (IOException e) {
                            connection.close();
                        }
                    }
                };
            }
        };
        server.setIoThreadsCount(4);
        server.start();

Notes

to build you will need to install libssl-dev

to build 32x version on 64x OS you will need to install libc6-dev-i386 libssl-dev:i386

Download

bintray

Versions

Version
0.3.4
0.3.3
0.3.2
0.3.1
0.3
0.2
0.1