加入收藏
举报
当前仅显示指定条件回帖 [ 展开查看全部 ]
02-14 20:03
#
文件名称:
session-h.md
所在目录:
Openharmony v1.0 / docs / docs-en / api / api-LinkIoT
文件大小:
6.75 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# session.h
## **Overview**
**Related Modules:**
[Softbus](softbus.md)
**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.


点赞 回复
回帖
支持markdown部分语法 ?