1 Star 0 Fork 4.9K

famoustang / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
session-h.md 6.77 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

session.h

Overview

Related Modules:

Softbus

Description:

Declares unified data transmission interfaces.

This file provides data transmission capabilities, including creating and removing a session server, opening and closing sessions, receiving data, and querying basic session information. After multiple nearby devices are discovered and networked, these interfaces can be used to transmit data across devices.

Since:

1.0

Version:

1.0

Summary

Data Structures

Data Structure Name

Description

ISessionListener

Defines session callbacks.

Functions

Function Name

Description

CreateSessionServer (const char *mouduleName, const char *sessionName, struct ISessionListener *listener)

int 

Creates a session server based on a module name and session name.

RemoveSessionServer (const char *mouduleName, const char *sessionName)

int 

Removes a session server based on a module name and session name.

SendBytes (int sessionId, const void *data, unsigned int len)

int 

Sends data based on a session ID.

GetMySessionName (int sessionId, char *sessionName, unsigned int len)

int 

Obtains the session name registered by the local device based on the session ID.

GetPeerSessionName (int sessionId, char *sessionName, unsigned int len)

int 

Obtains the session name registered by the peer device based on the session ID.

GetPeerDeviceId (int sessionId, char *devId, unsigned int len)

int 

Obtains the peer device ID based on a session ID.

CloseSession (int sessionId)

void 

Closes a connected session based on a session ID.

1
https://gitee.com/famoustang/docs.git
git@gitee.com:famoustang/docs.git
famoustang
docs
docs
master

搜索帮助