ServerSocket.Start
------------------

Starts the server socket to answer queries from other applications.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [ServerSocket](component_ServerSocket.md) | [3.2](newinversion32.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

### Deprecated

This function was [deprecated](deprecated.md). Use [WebHook](component_WebHook.md) functions instead.

MBS( "ServerSocket.Start"; Port; Login; Flags ) 

**MBS**( **"ServerSocket.Start";** /\* Starts the server socket to answer queries from other applications. \*/  
**$Port**; /\* The network port of the server to use.e.g. 9000 \*/   
**$Login**; /\* The login secret. Server will only answer if the logins match.e.g. "Hello" \*/   
**$Flags**) /\* Pass sum of flag values.e.g. 1+4 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Port | The network port of the server to use. | 9000 |
| Login | The login secret. Server will only answer if the logins match. | "Hello" |
| Flags | Pass sum of flag values. | 1+4 |

### Result

Returns OK or error.

### Description

Starts the server socket to answer queries from other applications.  
You can send queries from FileMaker or other development tools. See examples for details.  
This has nothing to do with a FileMaker Server. The plugin starts a socket which answers queries, so the current FileMaker instance becomes a kind of server.  
On FileMaker Server it looks like you must have a paused script to give time to the plugin for processing requests.  
  
With plugin version 3.3, we added FileMaker Go support. Please use Insert From URL Script Step with an URL like this: "http://" &amp; Server &amp; ":"&amp; Port &amp; "/" &amp; Login &amp; "/" &amp; Type &amp; "/" &amp; Query. Target a text field for the result, disable to show a dialog and use   
"Select entire contents" option. As browsers cache requests (e.g. Internet Explorer), you may want to add a random value to the request in order to avoid caching due to using same URL.  
  
Possible flag values:   
| 1 | Listen only for local connections. |
|--:|---|
| 2 | Block HTTP Access from e.g. FileMaker Go or Webviewer. |
| 4 | Block requests from plugin with ServerSocket.Query. |

  
FileMaker 13 Server does currently not like to execute scripts with 4.0 plugin.  
### Examples

Listen for local connections on port 12345

 MBS ( "ServerSocket.Start"; 12345; "secret"; 1 )  
### See also

- [ServerSocket.Check](ServerSocketCheck.md)
- [ServerSocket.Stop](ServerSocketStop.md)

### Example Databases

- [Network/ServerSocket/Server](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Network/ServerSocket/Server.shtml#1ScriptAnchor_)
- [Network/ServerSocket/ServerSocket from Webviewer/ServerSocket from Webviewer](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Network/ServerSocket/ServerSocket%20from%20Webviewer/ServerSocket%20from%20Webviewer.shtml#1ScriptAnchor_)

### Blog Entries

- [FileMaker and WebViewer communication](https://www.mbsplugins.de/archive/2018-08-24/FileMaker_and_WebViewer_commun/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.3pr6](https://www.mbsplugins.de/archive/2013-07-12/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.3pr1](https://www.mbsplugins.de/archive/2013-05-24/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 3/2013, Seite 24](https://filemaker-magazin.de/neuigkeit/3661-Appetithappen-FMM_201303)

This function checks for a license.

Created 18th August 2014 , last changed 17th October 2021

  
[ServerSocket.SetAllowedTypes](ServerSocketSetAllowedTypes.md) - [ServerSocket.Stop](ServerSocketStop.md)

[HTML Version](ServerSocketStart.shtml)