# Interface ISocket

Socket接口

#### Hierarchy

- ISocket

#### Implemented by

- WebSock

- Defined in assets/libs/network/NetInterface.ts:75

#####
Index

### Properties

onClosed
onConnected
onError
onMessage

### Methods

close
connect
send

## Properties

### onClosed

onClosed: null | SocketFunc

- Defined in assets/libs/network/NetInterface.ts:79

### onConnected

onConnected: null | SocketFunc

- Defined in assets/libs/network/NetInterface.ts:76

### onError

onError: null | SocketFunc

- Defined in assets/libs/network/NetInterface.ts:78

### onMessage

onMessage: null | MessageFunc

- Defined in assets/libs/network/NetInterface.ts:77

## Methods

### close

- close(code?: number, reason?: string): void

- #### Parameters

  - ##### `Optional` code: number

  - ##### `Optional` reason: string

  #### Returns void

  - Defined in assets/libs/network/NetInterface.ts:83

### connect

- connect(options: any): any

- #### Parameters

  - ##### options: any

  #### Returns any

  - Defined in assets/libs/network/NetInterface.ts:81

### send

- send(buffer: NetData ): number

- #### Parameters

  - ##### buffer: NetData

  #### Returns number

  - Defined in assets/libs/network/NetInterface.ts:82

Generated using TypeDoc