没有合适的资源?快使用搜索试试~ 我知道了~
首页CoDeSys_syslibsockets
CoDeSys_syslibsockets
需积分: 49 40 下载量 128 浏览量
更新于2023-03-03
评论
收藏 140KB PDF 举报
The library functions each call the correspondent function of the currently used operating system. Therefore please see the help system of the currently used operating system for detailled information on the particular OS functions.
资源详情
资源评论
资源推荐
The Library SysLibSockets.lib
© 3S – Smart Software Solutions GmbH / 16.12.2002
1
The Library SysLibSockets.lib
If the target system supports the functionality, this library supports the access on sockets for the
communication via TCP_IP and UDP.
The library functions each call the correspondent function of the currently used operating system.
Therefore please see the help system of the currently used operating system for detailled
information on the particular OS functions.
The functions, arranged alphabetically:
· SysSockAccept
· SysSockBind
· SysSockClose
· SysSockConnect
· SysSockCreate
· SysSockGetHostByName
· SysSockGetHostName
· SysSockGetOption
· SysSockHtonI
· SysSockHtons
· SysSockInetAddr
· SysSockInetNtoa
· SysSockloctl
· SysSockListen
· SysSockNtohI
· SysSockNtohs
· SysSockSelect
· SysSockSetIPAddress
· SysSockSetOption
· SysSockShutdown
TCP specific:
· SysSockRecv, SysSockSend
UDP specific:
· SysSockRecvFrom,
· SysSockSendTo
The Library SysLibSockets.lib
© 3S – Smart Software Solutions GmbH / 16.12.2002
2
SysSockAccept
This function of type DINT calls the function accept of the operating system in order to accept a
connection request to the socket. A new descriptor (handle) for the socket will be returned. The orignal
socket will be reset to the "listening" status (see SysSockListen).
Variable Data type Description
diSocket DINT A descriptor identifying a socket that has been placed in a listening
state with the SysSockListen function. The connection will actually
be made with the socket that is returned by the SysSockListen
function. The requested connection then will be made with that
socket, for which the SysSockAccept function returns a handle.
(corresponding parameter e.g. in Win32:s)
pSockAddr DWORD Pointer to a variable of type SOCKADDR; will be filled with the
address of the caller.
(corresponding parameter e.g. in Win32: addr)
diSocketAddrSize DINT Length of the structure SockAddr (can be retrieved via the SIZEOF
operator)
(corresponding parameter e.g. in Win32: addrlen)
Structure SOCKADDR:
sin_family : INT; (* Adress-family, defines address format, *)
sin_port : UINT; (* Port of the connection requesting unit *)
sin_addr : UDINT; (* IP-address of the requesting unit *)
sin_zero : ARRAY [0..7] OF SINT; (* buffer *)
SysSockBind
This function of type BOOL calls the function bind of the operating system. This function will allocate a
local address to the socket which was assigned before just to an address range by SysSockCreate. Usually
the "binding" will be done before functions like SysSockListen or SysSockAccept are called for a socket.
In case of successful operation the function will return TRUE, otherwise FALSE.
Variable Data type Description
diSocket DINT Descriptor of the socket, returned by SysSockCreate
(corresponding parameter e.g. in Win32: s)
pSockAddr DWORD Pointer to a variable of type SOCKADDR; (see
SysSockAccept)
diSockAddrSize DINT Lenght of the structure SOCKADDR (can be retrieved with the
aid of the SIZEOF operator)
The Library SysLibSockets.lib
© 3S – Smart Software Solutions GmbH / 16.12.2002
3
SysSockClose
This function of type BOOL calls the function closesocket of the operating system, in order to close a
socket.
In case of successful operation the function will return TRUE, otherwise FALSE.
Variable Data type Description
diSocket DINT Descriptor of the socket, returned by SysSockCreate
(corresponding parameter e.g. in Win32: s)
SysSockConnect
This function of type BOOL calls the function connect of the operating system. In case the socket has not
yet been "bound" by the SysSockBind function (see above), now automatically a local address will be
assigned to it. Afterwards the socket will be ready to send and /or receive data.
In case of successful operation the function will return TRUE, otherwise FALSE.
Variable Data type Description
diSocket DINT Descriptor of the socket, returned by SysSockCreate
(corresponding parameter e.g. in Win32: s)
pSockAddr DWORD Pointer auf eine Variable vom Typ SOCKADDR;
(see SysSockAccept)
diSockAddrSize DINT Length of the structure SOCKADDR (can be retrieved with the
aid of the SIZEOF operator)
SysSockCreate
This function of type DINT calls the function socket of the operating system. A new socket will be created
and assigned to a Service Provider.
The function returns the descriptor of the new socket, which is used as input parameter in other functions
of the library, e.g. SysSockBind, SysSockConnect.
Variable Data type Description
diAddressFamily DINT Address family
(corresponding parameter e.g. in Win32: af)
diType DINT One of the following two types can be used e.g. for Windows Sockets
1.1: SOCK_STREAM, SOCK_DGRAM
(corresponding parameter e.g. in Win32: type)
diProtocol DINT Protocol, depending on the chosen address family
(corresponding parameter e.g. in Win32: protocol)
剩余12页未读,继续阅读
zhoushuopeng
- 粉丝: 1
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2022年中国足球球迷营销价值报告.pdf
- 房地产培训 -营销总每天在干嘛.pptx
- 黄色简约实用介绍_汇报PPT模板.pptx
- 嵌入式系统原理及应用:第三章 ARM编程简介_3.pdf
- 多媒体应用系统.pptx
- 黄灰配色简约设计精美大气商务汇报PPT模板.pptx
- 用matlab绘制差分方程Z变换-反变换-zplane-residuez-tf2zp-zp2tf-tf2sos-sos2tf-幅相频谱等等.docx
- 网络营销策略-网络营销团队的建立.docx
- 电子商务示范企业申请报告.doc
- 淡雅灰低面风背景完整框架创业商业计划书PPT模板.pptx
- 计算模型与算法技术:10-Iterative Improvement.ppt
- 计算模型与算法技术:9-Greedy Technique.ppt
- 计算模型与算法技术:6-Transform-and-Conquer.ppt
- 云服务安全风险分析研究.pdf
- 软件工程笔记(完整版).doc
- 电子商务网项目实例规划书.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0