# Titanium.Network.Socket

> Socket module, used for creating sockets.

- Source: https://titaniumsdk.com/docs/sdk/13.1.1/Titanium.Network.Socket
- Titanium SDK version: 13.1.1
- Kind: module
- Platforms: Android, iPhone, iPad, macOS
- Since: Titanium SDK 1.7
- Extends: Titanium.Module
- Inheritance: Titanium.Module > Titanium.Proxy

## Properties

### CLOSED

- Type: Number
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

State value representing a closed socket.

### CONNECTED

- Type: Number
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

State value representing a connected socket.

### ERROR

- Type: Number
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

State value indicating an error has occurred on the socket.

### INITIALIZED

- Type: Number
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

State value representing an initialized socket.

The initial state of a newly-created socket.

### LISTENING

- Type: Number
- Platforms: Android, iPhone, iPad, macOS
- Permission: read-only

State value representing a socket that is listening for connections.

## Methods

### createTCP

- Platforms: Android, iPhone, iPad, macOS

Returns a new TCP socket object.

Takes a dictionary containing properties defined in [Titanium.Network.Socket.TCP](https://titaniumsdk.com/docs/sdk/Titanium.Network.Socket.TCP.md).  
Some properties are only needed based on whether the socket will be a connecting 
(client) socket or a listening (server) socket.

Parameters:

- `params` (Dictionary<Titanium.Network.Socket.TCP>, optional): Creation parameters.

Returns: Titanium.Network.Socket.TCP - New TCP socket.

## Inherited members

7 members are inherited. Each is documented on the type that declares it.

- [Titanium.Proxy](https://titaniumsdk.com/docs/sdk/13.1.1/Titanium.Proxy.md): `addEventListener`, `apiName`, `applyProperties`, `bubbleParent`, `fireEvent`, `lifecycleContainer`, `removeEventListener`

---

- This corpus documents Titanium SDK 13.4.1. Anything here that does not name a version describes 13.4.1.
- Titanium is maintained by TiDev. The Appcelerator toolchain is retired: there is no `appc` CLI, no Appcelerator Studio and no hosted build service. The supported CLI is `titanium` on npm, invoked as `ti`.

