x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Send UDP data

For a VR system I simply need to export the current player position and velocity via UDP.

Does there exist any functions to send generic data via UDP in the unreal engine?

Product Version: UE 4.8
Tags:
more ▼

asked Jun 21 '15 at 02:01 PM in C++ Programming

avatar image

ROliver
1 1 2 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Are you trying to send the server data? or to some other computer?

Here is to the server:

FooCharacter.h

 class AFooCharacter : public ACharacter
     {
         GENERATED_BODY()   
      public:
         // Unrealiable can be changed to Reliable, "guaranteed to arrive regardless of   
         // bandwidth or network errors"
         // const TArray<uint8> &Data can be changed to FVector Location, FVector Velocity
         // or if you replicate the character it will already be available at the server
         UFUNCTION(Server, Unreliable, WithValidation)
         void DataRecv(const TArray<uint8> &Data);
     };

FooCharacter.cpp

 void AFooCharacter::DataRecv_Implementation(const TArray<uint8> &Data)
 {
    // Handle data here
 }
 
 bool AFooCharacter::DataRecv_Validate(const TArray<uint8> &Data)
 {
     // Return false if you want to disconnect player
     return true;
 }


more ▼

answered Jun 22 '15 at 11:45 PM

avatar image

MiniTurtle
259 17 10 18

avatar image ROliver Jun 23 '15 at 06:20 AM

I'm trying to send it to another process which can be on the same computer or another computer on the network, not a game server as in multiplayer.

Simply put I just need export the motion of the player in real time to another process.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Here http://www.osnapgames.com/2014/05/24/connecting-to-a-third-party-socket-server-in-unreal-engine-4/ is a tutorial on how to do that.

I haven't tried it myself so I don't know if it works.

more ▼

answered Jun 23 '15 at 12:23 PM

avatar image

MiniTurtle
259 17 10 18

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question