使用SymbianOS套接字API

1.与套接字服务器建立会话

   RSocketSrv sockSrv;

   sockSrv.Connect();

2.创建并打开套接字

   RSocket sock;

   sock.Open(sockSrv,...);

3.设置目标地址

   TInetAddr类代表了一个端点的IP地址和端口。

 TInetAddr addr;

   addr.SetAddress(INET_ADDR(10,0,0,172))或addr.Input(_L("10.0.0.172"))

   addr.SetPort(80);

4.与远程服务器连接

 sock.Connect(addr,...);

5.发送数据包

   sock.Send(...);或sock.SendTo(...);

6.接收数据包

   sock.RecvOneOrMore(...);或sock.Recv(...);或sock.RecvFrom(...)

   RecvOneOrMore(iBuffer,...) 在收到一次或多个底层包后就通知, 所以可能iBuffer被填充了一个字节, 或者是填满, 这里iBuffer用10k与用4k没啥区别, 但是recv就是要收满缓存才返回, 一般不要使用recv.

7.关闭套接字和套接字服务器

   sock.Close();

   sockSrv.Close();

 

 

http://blog.csdn.net/wyymaomi/archive/2009/04/20/4093253.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
塞班60 PYTHON API The Python for S60 Platform (Python for S60) simplifies application development and provides a scripting solution for the Symbian C++ APIs. This document is for Python for S60 release 1.3.13 that is based on Python 2.2.2. The documentation for Python for S60 includes three documents: • Getting Started with Python for S60 Platform [5] contains information on how to install Python for S60 and how to write your first program. • This document contains API and other reference material. • Programming with Python for S60 Platform [6] contains code examples and programming patterns for S60 devices that can be used as a basis for programs. Python for S60 as installed on a S60 device consists of: • Python execution environment, which is visible in the application menu of the device and has been written in Python on top of Python for S60 Platform (see S60 SDK documentation [4]) • Python interpreter DLL • Standard and proprietary Python library modules • S60 UI application framework adaptation component (a DLL) that connects the scripting domain components to the S60 UI • Python Installer program for installing Python files on the device, which consists of: – Recognizer plug-in – Symbian application written in Python The Python for S60 developer discussion board [9] on the Forum Nokia Web site is a useful resource for finding out information on specific topics concerning Python for S60. You are welcome to give feedback or ask questions about Python for S60 through this discussion board. 1.1 Scope This document includes the information required by developers to create applications that use Python for S60, and some advice on extending the platform. 1.2 Audience This guide is intended for developers looking to create programs that use the native features and resources of the S60 phones. The reader should be familiar with the Python
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值