BeneBarros Active Member Licensed User Longtime User Jan 7, 2019 #1 I have a server using the "JServer" and working perfect. Now I have some devices that I need to check whether they are connected or not. I'm thinking of using the "ServerSocket" and creating a Client class. Can I do this in the same application? Can I use the same port?
I have a server using the "JServer" and working perfect. Now I have some devices that I need to check whether they are connected or not. I'm thinking of using the "ServerSocket" and creating a Client class. Can I do this in the same application? Can I use the same port?
Erel B4X founder Staff member Licensed User Longtime User Jan 7, 2019 #2 BeneBarros said: Can I do this in the same application? Click to expand... Yes. BeneBarros said: Can I use the same port? Click to expand... No. In most cases it is a mistake. It is easy to mess things up with ServerSocket, especially if you want to support multiple clients. What do you need it for? Upvote 0
BeneBarros said: Can I do this in the same application? Click to expand... Yes. BeneBarros said: Can I use the same port? Click to expand... No. In most cases it is a mistake. It is easy to mess things up with ServerSocket, especially if you want to support multiple clients. What do you need it for?
BeneBarros Active Member Licensed User Longtime User Jan 7, 2019 #3 Erel said: Yes. No. In most cases it is a mistake. It is easy to mess things up with ServerSocket, especially if you want to support multiple clients. What do you need it for? Click to expand... is an existing server with JServer serving several PCs. Now I need to include the android devices that are Free Lancer employees. When a customer contacts the company, I need to know which employee is connected and closest to the service. Upvote 0
Erel said: Yes. No. In most cases it is a mistake. It is easy to mess things up with ServerSocket, especially if you want to support multiple clients. What do you need it for? Click to expand... is an existing server with JServer serving several PCs. Now I need to include the android devices that are Free Lancer employees. When a customer contacts the company, I need to know which employee is connected and closest to the service.
Erel B4X founder Staff member Licensed User Longtime User Jan 7, 2019 #4 Use OkHttpUtils2 to communicate with the server. Upvote 0
BeneBarros Active Member Licensed User Longtime User Jan 7, 2019 #5 Erel said: Use OkHttpUtils2 to communicate with the server. Click to expand... In sending data I am using OkHttpUtils2, but it does not provide me with the information whether it is connected or not. Upvote 0
Erel said: Use OkHttpUtils2 to communicate with the server. Click to expand... In sending data I am using OkHttpUtils2, but it does not provide me with the information whether it is connected or not.
Erel B4X founder Staff member Licensed User Longtime User Jan 7, 2019 #6 There is no such thing. The connection is made when you send the request. If you want to maintain a persistent connection then use WebSockets (which are supported by jServer). Upvote 0
There is no such thing. The connection is made when you send the request. If you want to maintain a persistent connection then use WebSockets (which are supported by jServer).