getnamo / TCP-Unreal

Convenience TCP wrapper for Unreal Engine
MIT License
106 stars 36 forks source link

Question: does this let you setup a TCP socket in an Unreal game client that can receive messages? #11

Open mangoplane opened 1 year ago

mangoplane commented 1 year ago

Hey again.

First of all great work, I'm grateful for your packages.

I just had a question as explained in the title: does this let you setup a TCP socket in an Unreal game client that can receive messages?

My use case is for sending data from an external app, say a web browser, through to Unreal. TLS isn't required.

Kind regards.

getnamo commented 1 year ago

It does, see https://github.com/getnamo/TCP-Unreal#how-to-use---basics for example gists of nodejs TCP server and clients that connect to their reciprocate tcp components in unreal.

Although if you're using the web I'd go with the Socket.IO client plugin for easier data conversion to unreal types and code organization via event handling: https://github.com/getnamo/SocketIOClient-Unreal. It has an example chat example between web and unreal: https://github.com/getnamo/SocketIOClient-Unreal-example

mangoplane commented 1 year ago

That's awesome.

Although if you're using the web I'd go with the Socket.IO client plugin for easier data conversion to unreal types and code organization via event handling: https://github.com/getnamo/SocketIOClient-Unreal. It has an example chat example between web and unreal: https://github.com/getnamo/SocketIOClient-Unreal-example

Yeah regarding that, I've just hit a snag which is I got the TCPServer setup only to realize HTTP protocol isn't setup. Will take a look at SocketIO. My understanding is I can still use Native Browser Websockets to handle the connection.

mangoplane commented 1 year ago

Actually this should be adequate, I only need to pass one string value over HTTP -- it is passed back as a parsable string. Have enough to work with. Thanks again! :)

getnamo commented 1 year ago

The socket.io plugin expects socket.io protocol over websockets, but if you want native transport only, you can use TCP for emitting and receiving bytes, but utilize the socket.io JSON conversion utilities to simplify data conversion to unreal types.