Using a custom server socket in QuickServer

65 views
Skip to first unread message

Damien Grandemange

unread,
Aug 23, 2013, 9:30:51 AM8/23/13
to quick...@googlegroups.com
Hi,

I am Damien from France and am currently looking for a  server that can actually deals with Unix domain sockets (rather than network sockets). Even if QuickServer is a network server, i am interested in the way it handles client request, and wish i could benefit this.

There's some existing java implementation of Unix domain socket in java. junixsocket implementation for instance is very interesting because it actually reuses the java Socket API, so that you got for instance a AFUNIXServerSocket class that extends java.net.ServerSocket.

I wish i can use QuickServer to make a server socket using this AFUNIXServerSocket to be able to serve clients connecting through Unix domain sockets.

I've noticed that the main QuickServer class has a protected void makeServerSocket() method (non final, so one can override it) but it seems tha actual implementation refers to some private members (especially the private ServerSocket server member) which makes the class hardly extensible.

Do you see any good strategies I could use to achieve my goal ?

Thank you.

Damien Grandemange

unread,
Aug 26, 2013, 12:44:54 PM8/26/13
to quick...@googlegroups.com
Eventually works by overriding makeServersocket() and stopServer() methods.

Requires :
*reflection : to access QuickServer parent instance 's private members/methods,
*mockito : to provide dummy InetAddress to AFUNIXSocket client socket instances; Quick server 's BasicClientHandler implementation actually uses Socket.getInetAddress() to retrieve client host name,

Full code in attached file.
QuickServerAFUNIX.java

Akshath

unread,
Aug 27, 2013, 11:23:03 AM8/27/13
to quick...@googlegroups.com
Nice work Damien.

Have made both the fields & method you needed to protected.. so u can use it directly without reflection. Do checkout the code from SVN head.

Damien Grandemange

unread,
Aug 28, 2013, 4:49:09 AM8/28/13
to quick...@googlegroups.com
Ok, thank you.
As i am actually working with Maven, do you plan to release a version in any maven repository in a near future ?
Reply all
Reply to author
Forward
0 new messages