[4.8 promoted] Compiler Error when Creating WebSocketNetDriver Class

After enabling “Experimental HTML5 Networking Plugin” and then creating a new c++ class based on “WebSocketNetDriver”, getting this compiler error :

CompilerResultsLog:Error: Error D:\UnrealProjects\UnrealSource\UnrealEngine\Engine\Plugins\Experimental\HTML5Networking\Source\HTML5Networking\Classes\WebSocketNetDriver.h(51) : error C2143: syntax error : missing ‘;’ before ‘'D:\UnrealProjects\UnrealSource\UnrealEngine\Engine\Plugins\Experimental\HTML5Networking\Source\HTML5Networking\Classes\WebSocketNetDriver.h(51) : error C2143: syntax error : missing ‘;’ before '
CompilerResultsLog: Info
CompilerResultsLog:Error: Error D:\UnrealProjects\UnrealSource\UnrealEngine\Engine\Plugins\Experimental\HTML5Networking\Source\HTML5Networking\Classes\WebSocketNetDriver.h(51) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-intD:\UnrealProjects\UnrealSource\UnrealEngine\Engine\Plugins\Experimental\HTML5Networking\Source\HTML5Networking\Classes\WebSocketNetDriver.h(51) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
CompilerResultsLog: Info
CompilerResultsLog:Error: Error D:\UnrealProjects\UnrealSource\UnrealEngine\Engine\Plugins\Experimental\HTML5Networking\Source\HTML5Networking\Classes\WebSocketNetDriver.h(57) : error C2061: syntax error : identifier 'FWebSocket’D:\UnrealProjects\UnrealSource\UnrealEngine\Engine\Plugins\Experimental\HTML5Networking\Source\HTML5Networking\Classes\WebSocketNetDriver.h(57) : error C2061: syntax error : identifier ‘FWebSocket’

Thanks,

Hey -

I downloaded the promoted build from GitHub today and so not see anything referencing HTML5 in the Experimental section of the Editor Preferences. Also, when creating a new C++ class I don’t see the option to use “WebSocketNetDriver” as the parent class. Could you give the steps you used to enable these settings?

Cheers

Go to window-plugins-networking and enable “Experimental HTML5 networking plugin” and then you can create new class with reference to “WebSocketNetDriver”.

Thanks,

Hey -

The failure to create a new class with WebSocketNetDriver has been bugged (UE-14572) for further investigation. As this is an experimental feature it is difficult determine exactly when a fix will be implemented.

Cheers

Hey -

This plugin is experimental and is for unreal multiplayer networking. That being said - this plugin is intended to be a leaf. You shouldn’t be creating classes based on it.

As of now this is distributed as source and not as a built binary so its only available via source distribution - you can find the Readme at (Engine\Plugins\Experimental\HTML5Networking\README.md). You can use this plugin to allow HTML5 clients and other platforms clients to play against each other on the same server.

If you want to use just plain websockets for HTML5 ( for connecting to non-unreal servers), you can just use BSD Socket API which automatically talks on websocket protocol for HTML5.

If you can explain your use case, I will be in a better position to provide color.

Thanks,

Thanks for the reply.
That what we are trying to do, use websockets inside unreal to connect to external server and send/receive messages from external HTML5 page. Can you explain what BSD Socket API is?

Thanks,

Just to clarify. I am assuming you are not building the game for HTML5 platform. What you want/have is a generic web-socket server to which you want both the game and a html5 web page to connect so that they can exchange data.

For providing websocket support in UE we internally use libwebsocket. You can use this c library in your game/plugins to connect to a websocket server directly and exchange data. You can find examples on how to use it within the engine and within their distribution. We only distribute built versions for windows and mac - for other platforms you would need to build it yourself.

BSD Socket API is wrapped by Unreal as FSocket classes. And only within the HTML5 platform they behave as websocket.

Let me know if any other questions.

libwebsocket is way to go then. I will try to create plugin with that.
Thanks for the help.

Thanks,