Jump to content

callRemote Problem


Bonsai

Recommended Posts

Posted

Hey,

I was trying to use callRemote to exchange messages between servers, but sometimes there is a HUUUGE delay or the message doesnt reach the other server at all.

So, is that something that can be fixed?

Is this happening because of some internal MTA stuff?

I tried to use the socket module, but for some reason there is no way to listen on a socket, which makes them kinda useless.

And the curl module is not available for linux servers.

Anyone knows what to do about this?

Bonsai

  • MTA Team
Posted

Is callRemote or fetchRemote being used for anything else (in any running resource)?

Posted

No, its only used in that one resource.

But it might be used several times in a short amout of time, like when u try to send more messages.

Posted

They both have the same ip, but different ports. Its using the HTTP port from the config file, which in this case is the same as the server port.

Posted

HTTP port is same as server port? Try using different port (for example 22005 for HTTP and 22003 for server)

  • MTA Team
Posted
HTTP port is same as server port? Try using different port (for example 22005 for HTTP and 22003 for server)

There is no problem on using the same port for server and HTTP as server runs con UDP protocol and HTTP runs on TCP protocol.

Posted

I now added the server ip to the mta config file for:

<http_dos_exclude></http_dos_exclude> 

I'm not sure yet if it helps anything tho.

Bonsai

  • MTA Team
Posted

Check the server log for:

HTTP: Connection flood from x.x.x.x 

  • MTA Team
Posted

Unzip this resource on both servers: https://nightly.multitheftauto.com/files/temp/ca ... e_test.zip

Check the meta.xml and set the correct ip/port for the other server.

Also make sure the ACL is updated as shown in the meta.xml comments.

When the resource is running in both servers, enter the command 'begintest'

The resource will continually send messages via callRemote and report errors. Show any errors here.

Posted

So I did as you said and did some tests with it.

There was not a single error shown.

As far as I understood it only tries to send once.

Does that have any effect on the following messages?

Like as long as the first message was not successfully sent, the second one won't be taken care of?

But it should have shown an error anyway if it didnt get through.

So, I really i don't why i had these huges problems before, i feel like it got better after I changed something, but sometimes it still has huge delays.

I'll do some more tests with this tool later to make sure.

Thanks for your help.

Bonsai

  • MTA Team
Posted

The sends are queued and processed one at a time, but there should always be a response via the callback.

I've updated the callRemote example to output errors/problems in the callback function.

Posted

maybe you just made bad code? I have happend to my self exact same thing but between client and server side's. I remaded bit code and it fixed a problem.

Posted

Yeah, thats what I thought too before I posted here.

But the problem was not reproducible, and especially the delay problem can't be caused by a problem in the code I think.

After I remade some part, it became a bit better because I got rid of one callRemote usage, so you wouldn't see a problem that often.

Maybe the hoster was having a problem or something?

Right now its working pretty good.

Thanks again.

Bonsai

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...