Difference between revisions of "Libwebsockets"

From havefunsoft wiki
Jump to: navigation, search
m (Building)
m (Pascal Header)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
A great web sockets library.
 +
The library is written in C, thus it's great to be ported to any other language.
 +
==Pascal Header==
 +
Pascal headers (Pascal Bindings) are available.
 +
SVN access (read-only) is here:
 +
* https://havefunsoft.com/svn/libws/trunk
 +
The nightly-build archive can be downloaded from the link [[#See Also|below]].
 +
 
==Building==
 
==Building==
 
Since I'm a fan of static linking, I'm using mingw to build (unix) libraries for FPC.
 
Since I'm a fan of static linking, I'm using mingw to build (unix) libraries for FPC.
Line 15: Line 23:
 
Apprently pollfd structure gets declared somewhere else (libwebsockets.h?) and having it declared here is causing a conflict.
 
Apprently pollfd structure gets declared somewhere else (libwebsockets.h?) and having it declared here is causing a conflict.
 
or maybe it's an issue with C compiler.
 
or maybe it's an issue with C compiler.
 +
==See Also==
 +
* https://libwebsockets.org/ - the official library site
 +
* http://havefunsoft.com/share/libws-build.zip - nightly build of libwebsockets pascal headers
 
[[Category:WebSockets]]
 
[[Category:WebSockets]]

Latest revision as of 12:35, 8 April 2018

A great web sockets library. The library is written in C, thus it's great to be ported to any other language.

Pascal Header

Pascal headers (Pascal Bindings) are available. SVN access (read-only) is here:

The nightly-build archive can be downloaded from the link below.

Building

Since I'm a fan of static linking, I'm using mingw to build (unix) libraries for FPC.

Libwebsockets building instructions for MinGW are pretty accurate. Except for Winsock2.h modifications. (Probably due to changes in Mingw headers themselves)

The needed changes to Winsock2.h look like this:

#if(_WIN32_WINNT >= 0x0600)
    
typedef struct WSAPOLLFD *PWSAPOLLFD, FAR *LPWSAPOLLFD;
 
WINSOCK_API_LINKAGE int WSAAPI WSAPoll(LPWSAPOLLFD fdArray, ULONG fds, INT timeout);

#endif // (_WIN32_WINNT >= 0x0600)

Apprently pollfd structure gets declared somewhere else (libwebsockets.h?) and having it declared here is causing a conflict. or maybe it's an issue with C compiler.

See Also