【发布时间】:2014-02-19 17:16:22
【问题描述】:
我想知道如何在两个客户端之间共享一个套接字单一连接。我已经按照以下方式进行了编程,需要为其余的开发提供建议。
Socket (Java desktop program)
|
|
|<---------------------->|
| |
iOS Mobile client Java Applet (Runs on desktop where same Socket is there)
步骤是,
1. Java Applet connect with this socket and gets a random number from this socket, in the very first call. It is developed.
[Socket program accepts client and creates a Thread and runs ]
2. I have a text field in iOS Mobile client where user will type that random number (shared the rand number via phone or chat) which it got from that Applet. It is developed.
3. iOS Mobile client sends this random number and also get it connected with socket. It is developed.
4. I need to share images from iOS client to Applet now via this socket established.
我想知道,如何使“Applet 与套接字连接”和“iOS 客户端与套接字”处于同一连接中,以便我可以通过此套接字连接将图像从 iOS 应用程序共享到 Applet?可以像这样在两个客户端(iOS 和 Applet)之间共享单个套接字连接吗?
请告诉我,如何在两个客户端之间建立相同的连接来实现上述第四点。
谢谢!
【问题讨论】:
标签: java sockets serversocket