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"

4.7.3 tcp ports not closing

Hi there,

In previous versions 4.6 and below when the connection to ports were closed in code. E.g when an actor is destroyed the port could then be reused by the same actor in a different level for example. However in 4.7 this now no longer works. The ports when using .Close() in code seems now not to close the connection.

Has anyone else had this problem had this problem?

Something very similar has been reported here.

Regards,

Peter

Product Version: Not Selected
Tags:
more ▼

asked Apr 14 '15 at 01:52 PM in Bug Reports

avatar image

pwsnow
28 5 12 16

avatar image Doug E ♦♦ STAFF Apr 21 '15 at 01:59 PM

Hey pwsnow-

Could you elaborate on your issue for me? What ports are you referring to? How are you using Close()? Could you provide an example of what you're seeing or steps to follow to reproduce this on our end?

Cheers

Doug Wilson

avatar image pwsnow Apr 22 '15 at 11:16 AM

Thanks Doug for the reply.

I have some custom C++ plugin, which acts as a TCP receiver attached to an actor. A TCP blueprint derived from the plugin is created which (for the sake of example) prints received data from a selected port and address. On each level blueprint a TCP initializer box is run on level startup. What should happen is that the tcp connection is destroyed when changing maps this would free up the port.

Now the plugin’s creator has told me that in previous versions of UE4 the plugin has worked perfectly.

For example, with the previous set up; I have an external program, which pipes data to UE4 on a set address and port. When I play a level data is printed which is what I expect. However when I change map I would expect the same behavior to happen, data being printed. However this isn’t the case.

Below is the EndPlay method of the plugin:

 void ATCPReceiver::EndPlay(const EEndPlayReason::Type EndPlayReason)
 {
     Super::EndPlay(EndPlayReason);
     //~~~~~~~~~~~~~~~~
     
     //Clear all sockets!
     //        makes sure repeat plays in Editor doesn’t hold on to old sockets!
     if(ListenerSocket)
     {
         ListenerSocket->Close();
         ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->DestroySocket(ListenerSocket);
     }
     if(ConnectionSocket)
     {
         ConnectionSocket->Close();
         ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->DestroySocket(ConnectionSocket);
     }    
 }

I have confirmed that this code is being executed by printing log messages before and after the close lines. So I am confident that this method is being executed.

This problem with the close method not working is also highlighted here

I have tried in the above link the solution of using reusable sockets but this doesn’t solve the problem.

If you require any more information please give me a shout, would be good to solve this.

Peter

avatar image pwsnow Apr 22 '15 at 11:17 AM

I have emailed the plugin’s creator to ask exactly which version of UE4 the plugin works perfectly as should do mentioned above but I have looked on GitHub at previous versions Close() methods in the engine and I can’t see much of a difference from previous version and 4.7.3.

avatar image Tim C ♦♦ STAFF Apr 23 '15 at 05:58 PM

Hi pwsnow,

What is the plugin that you are using for this?

Tim

avatar image pwsnow Apr 27 '15 at 08:38 AM

Its actually a plugin from Rama, he has tested it and confirmed that the plugin no longer works properly in 4.7.

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Solution

Following this work flow I was able to reopen socket after changing levels:

  1. start first level

  2. start python script

  3. observe the onscreen msgs

  4. open console, open new level (this closes first socket and opens new one)

  5. reactivate the python script //<~~~~~

I did not do step 5 in my initial tests, it seems that when the UE4 socket closes, the Python script gets stopped too!

I was not expecting the python script to close when the ue4 socket closed, so that is why I did not resolve this sooner.

Now I know I have to restart the python script if the UE4 socket connection gets closed :)

Thank you for UE4 Epic!

Rama

more ▼

answered Apr 28 '15 at 12:18 AM

avatar image

Rama
10.6k 445 343 1083

(comments are locked)
10|2000 characters needed characters left

Hi pwsnow,

Unfortunately we are not able to provide support for plugins created by another user. If Rama is able to update his plugin to work with 4.7, it should also resolve the issue you are experiencing. If you continue to have trouble after the plugin is updated, we can try to find out what is happening (if it is something happening between the Engine and the plugin, Rama may need to get in touch with us to resolve it).

I will mark this post as resolved for now, but it can be re-opened later if necessary.

Tim

more ▼

answered Apr 27 '15 at 07:41 PM

avatar image

Tim C ♦♦ STAFF
18.1k 423 69 286

(comments are locked)
10|2000 characters needed characters left
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