Modifying an Ethernet-based library to work for WiFi

Hello,

I've been busy working on a project where i need arduino to act as a WiFi WebSocketServer.
There exists a library for this, only it is based on an Ethernet shield (and thus the Ethernet library).
What i want to do is abstract the Ethernet dependancy away, and get it working with WiFi
(to be more specific, with RN-XV module and the WiFlyHQ library).

I am also going to order an Ethernet shield and mini WiFi client, so if this fails i can try to do it the somewhat 'cumbersome' way.

It seems the WebSocketServer library relies on 2 arduino core classes, Server.h and Client.h
But these seem to just be interfaces, or, i can't find the .cpp implementation files.

In arduino code, in the WebSocketServer examples, Ethernet.begin(mac, ip); is called (with a mac byte and ip byte of course)
Can anyone explain to me how the WebSocketServer relies on the Ethernet library, because then i might
be able to remove this dependancy and get it working with the WiFlyHQ library!

I hope my question is clear!

A quick overview gives me the same impression as you had: it's depending on Server.h and Client.h and not Ethernet.h itself. Have you tried just replacing the #include <Ethernet.h> with your library's include statement?

supermaggel:
It seems the WebSocketServer library relies on 2 arduino core classes, Server.h and Client.h
But these seem to just be interfaces, or, i can't find the .cpp implementation files.

The Server and Client classes are purely abstract classes, defining an interface that other classes must inherit and implement themselves. The Ethernet library does this with EthernetClient and EthernetServer, which inherit Client and Server and provide an actual implementation of their pure virtual methods.

WiFlyHQ only inherits the Stream class, and thus will not be able to easily replace the Ethernet library, since the Websocket library relies on the Server and Client base classes.

Ah, they're abstract classes, figures. i was suspecting it used the EthernetServer / Client classes, but i couldn't figure out how these abstract classes are used in C++. Hmm, if i can figure out what features the EthernetClient has that are used, i might be able to create the same functionality with the WiFlyHQ library. I mean, the Handshake is just plain text and some encrypted keys, and then the full duplex connection is just a TCP socket connection as far as i understand. the WiFlyHQ library should be able to do that...