Automatic UDP Receiving with MBS not working

I'm trying to use the MBS UDP Receive function in my solution, but for some reason records do not automatically get created in my listening database. When I manually run the "ReadSomething" script, however, the records are then created. The demo file worked once and now it has the same issue I'm facing. I've tried:

  • Allowing both scripts full access
  • Updating the MBS plugin
  • Restarting, etc

If anyone sees that I've missed something here, please let me know. Thanks in advance!

This is not the fmplugin privilege, that is missing for the plugin to trigger scripts?

e.g. our FM.RunScript would not work if that privilege is missing.

1 Like

Thank you, I didn't realize Claris implemented this in recent FM versions. Apologies for the ignorance. You're great!

Sorry, I'm new to this but I don't understand. Whats the issue and how do you solve it? Thank you for the education

Welcome to Thesoup @wolfmans !

@MonkeybreadSoftware will answer you shortly, that was Claris Engage this week and he will get back home (Germany) , maybe he his in the plane at this time.

Well, if something in MBS Plugin doesn't work as expected, please check the Trace function. It allows you to write a log about plugin calls.

See blog post:
How to use Trace

If the plugin tries to trigger a script, the log may show an error, that triggering the script failed due to a security limitation. In that case, the log will show such an error and you can check if your extended privileges includes "fmplugin". You may need to allow fmplugin or fmpluginMBSP extended privilege to allow scripts to run.
See
Trigger scripts via plugin and fmplugin extended privilege

1 Like

Hmmm… unsure the explanation was clear.

The original post indicated a function from the MBS plugin, which used to work correctly, suddenly stopped working. The poster tried several steps in vain to resolve the issue.

@MonkeybreadSoftware noted that a specific privilege set is required for the plugin to invoke a FileMaker script.

Hope this helps!

P.S. The Soup is an anglophone forum but its members hail from many parts of the world. English is not necessarily their first language and cultures vary quite a bit.

Hello,

Thank you for the help already! Here is what I got and understood.

I have added a Trace on the first line to MBS UDP Receiver example file in its CreateSocket script. I got the txt file which gave me this:

Script "CreateSocket" in file "UDP Receiver".
MBS Plugin call #1 with 2 parameters.
Parameter 0 FunctionName: "Trace"
Parameter 1 path: "/Users/linask/Desktop/trace.txt"
Result #1: "OK"

MBS Plugin call #2 with 3 parameters.
Parameter 0 FunctionName: "Socket.Listen"
Parameter 1 SocketID: "29001"
Parameter 2 Port: 4704
Result #2: "[MBS] Failed to bind to this port. Error 22: Invalid argument"

I'm not sure how I can fix that error but its not allow me to connect/see the messages.

Sorry for the inconvience. Really trying to understand all of this

did you run the script multiple times already?
Sounds like the port is in use maybe by another socket you created before?

Hello,

That worked better! I restarted the file and ran the scripted again and it looked promising.

Script "CreateSocket" in file "UDP Receiver".
MBS Plugin call #1 with 2 parameters.
Parameter 0 FunctionName: "Trace"
Parameter 1 path: "/Users/linask/Desktop/trace.txt"
Result #1: "OK"

MBS Plugin call #2 with 1 parameter.
Parameter 0 FunctionName: "Socket.NewUDPSocket"
Result #2: "29001"

MBS Plugin call #3 with 3 parameters.
Parameter 0 FunctionName: "Socket.Listen"
Parameter 1 SocketID: "29001"
Parameter 2 Port: 4704
Result #3: "OK"

MBS Plugin call #4 with 4 parameters.
Parameter 0 FunctionName: "Socket.SetDataAvailableHandler"
Parameter 1 SocketID: "29001"
Parameter 2 FileName: "UDP Receiver"
Parameter 3 ScriptName: "ReadSomething"
Result #4: "OK"

Now maybe this is my real question, is there a a specific syntax that MBS wants so that it recognizes the message? I know when I was transmiting, the other software I was using wanted a specific syntax. What do I need to do so that I see the message in FM?

We just receive whatever is coming.

You may see your data available script get called.

You can call Socket.ReadAll and see if you get something back.