# StartSocketServer Method - neoVI API

This method starts the TCP/IP socket server at a specified port.

{% tabs %}
{% tab title="C/C++ Declare" %}

```cpp
int _stdcall icsneoStartSockServer(int hObject, int iPort);
```

{% endtab %}

{% tab title="Visual Basic .NET Declare" %}

```vbnet
Public Declare Function icsneoStartSockServer Lib “icsneo40.dll” (ByVal hObject As Integer, ByVal iPort As Integer) As Integer
```

{% endtab %}

{% tab title="C# Declare" %}

```csharp
[DllImport(“icsneo40.dll”)] public static extern int icsneoStartSockServer(int hObject, int iPort);
```

{% endtab %}
{% endtabs %}

**Parameters**

hObject

\[in] Handle which specifies the driver object created by [OpenNeoDevice](/neovi-api/win32-api-overview-intrepidcs-api/basic-functions-overview-intrepidcs-api/openneodevice-method-intrepidcs-api.md)

iPort

\[in] specifies the TCP/IP Port where the server will be established.

**Return Values**

If the server was started successfully the return value will be non-zero.

**Remarks**

This method creates a TCP/IP server in the DLL. This server can be attached to by any TCP/IP clients using the RAW API or using the DLL by specifying TCP/IP with [OpenNeoDevice](/neovi-api/win32-api-overview-intrepidcs-api/basic-functions-overview-intrepidcs-api/openneodevice-method-intrepidcs-api.md). Only one server is allowed at a time.

### Examples

{% tabs %}
{% tab title="C/C++ Example" %}

```cpp
icsneoStartSockServer(hObject, iPort);
```

{% endtab %}

{% tab title="Visual Basic .NET Example" %}

```vbnet
bStatus = icsneoStartSockServer(m_hObject, iPort)) '// start the socket server
```

{% endtab %}

{% tab title="C# Example" %}

```csharp
iStatus = icsNeoDll.icsneoStartSockServer(m_hObject, Convert.ToInt32(txtServerPort.Text));
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.intrepidcs.com/neovi-api/win32-api-overview-intrepidcs-api/general-utility-functions-overview-intrepidcs-api/startsocketserver-method-intrepidcs-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
