Blackberry HttpConnection Connector.open 模式
这可能是一个愚蠢的问题,但是我从未真正考虑过连接器模式的目的,只是使用默认值(READ_WRITE)。调用 Connector.open 及其三种不同模式之间有什么区别?
1) 连接器.READ
2)连接器.WRITE
3) Connector.READ_WRITE
(实际上只有 1/2,因为这显然是两者)
另外,“设置端到端所需/所需”是什么意思。我相当确定我知道,但文档很模糊。
谢谢
This may be a stupid question, however I've never really put much thought into the purpose of a connector mode and just used the default (READ_WRITE). What are the differences between calling Connector.open with its three different modes.
1) Connector.READ
2) Connector.WRITE
3) Connector.READ_WRITE
(Really only 1/2 since this is obviously both)
Also, what does the "Set end to end required/desired" mean. I am fairly sure I know but the documentation is hazy.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
显然,如果使用
Connector.READ
打开连接,则无法写入连接,反之亦然。还有一点,检查一下: 最大同时连接数。我记得我在某处读到,当您使用
Connector.READ_WRITE
时,系统使用 2 个连接句柄,而不是唯一的。抱歉,不知道你在这里的意思。
更新:
检查 javax.microedition.io.Connector 的 API 。在 RIM 在 API 5.0 中推出
ConnectionFactory
之前,所有开发人员都使用它。关于端到端标志有一个解释:Obviously you can not write to connection if it's opened with
Connector.READ
and vice versa.There's also another point, check this: Maximum number of simultaneous connections. I remember I read somewhere that when you use
Connector.READ_WRITE
, then system uses 2 connection handles versus the only.Sorry, not sure what you mean here.
UPDATE:
Check the API for javax.microedition.io.Connector. It was used by all developers before RIM rolled out the
ConnectionFactory
in API 5.0. There is an explanation about end-to-end flag:例如,如果您执行文件操作。Connector.READ-仅用于从文件中读取,Connector.WRITE-用于写入文件,Connector.READ_WRITE-用于读取以及写入文件。
For example if u perform file operation.Connector.READ- is used to only read from file,Connector.WRITE-is used to write to file,Connector.READ_WRITE-is used read as well as write into file.