> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/scene-fusion/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sflocalsession.md).

# Class sfLocalSession

Namespace: [KS.SceneFusion.Client.Unity.Editor](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor.md)\
Assembly: KSUnity-Source.dll

```csharp
public class sfLocalSession : sfILocalSession
```

#### Inheritance

object ← [sfLocalSession](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sflocalsession.md)

#### Implements

[sfILocalSession](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfilocalsession.md)

## Properties

### IsRunning <a href="#ks_scenefusion_client_unity_editor_sflocalsession_isrunning" id="ks_scenefusion_client_unity_editor_sflocalsession_isrunning"></a>

Check if a session process is already running.

```csharp
public bool IsRunning { get; }
```

#### Property Value

bool

## Methods

### ReadStdErr() <a href="#ks_scenefusion_client_unity_editor_sflocalsession_readstderr" id="ks_scenefusion_client_unity_editor_sflocalsession_readstderr"></a>

Reads and closes the standard error stream from the local server process. Does not read if the process is still running.

```csharp
public string ReadStdErr()
```

#### Returns

string

standard error, or null if the standard error stream could not be read.

### ReadStdOut() <a href="#ks_scenefusion_client_unity_editor_sflocalsession_readstdout" id="ks_scenefusion_client_unity_editor_sflocalsession_readstdout"></a>

Reads and closes the standard output stream from the local server process. Does not read if the process is still running.

```csharp
public string ReadStdOut()
```

#### Returns

string

standard output, or null if the standard output stream could not be read.

### ServerCheck() <a href="#ks_scenefusion_client_unity_editor_sflocalsession_servercheck" id="ks_scenefusion_client_unity_editor_sflocalsession_servercheck"></a>

Check that a local SF server exists and that it is compatible with the current SF version

```csharp
public static sfLocalSession.ServerState ServerCheck()
```

#### Returns

[sfLocalSession](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sflocalsession.md).[ServerState](/scene-fusion/api-reference/ks.scenefusion.client.unity.editor/ks.scenefusion.client.unity.editor.sflocalsession/ks.scenefusion.client.unity.editor.sflocalsession.serverstate.md)

### Start(int, string, StartCallback) <a href="#ks_scenefusion_client_unity_editor_sflocalsession_start_system_int32_system_string_ks_scenefusion_cl" id="ks_scenefusion_client_unity_editor_sflocalsession_start_system_int32_system_string_ks_scenefusion_cl"></a>

Starts the local server instance. If a local server is already running, stops it and starts a new one.

```csharp
public void Start(int port, string sessionId, sfILocalSession.StartCallback callback)
```

#### Parameters

`port` int

Port

`sessionId` string

Session id

`callback` [sfILocalSession](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfilocalsession.md).[StartCallback](/scene-fusion/api-reference/ks.scenefusion.client/ks.scenefusion.client.sfilocalsession/ks.scenefusion.client.sfilocalsession.startcallback.md)

Callback to call on success/fail.

### Stop() <a href="#ks_scenefusion_client_unity_editor_sflocalsession_stop" id="ks_scenefusion_client_unity_editor_sflocalsession_stop"></a>

Stop the current session

```csharp
public bool Stop()
```

#### Returns

bool

true if the local session was running.
