7 Replies - 323 Views - Last Post: 22 April 2020 - 03:35 AM Rate Topic: -----

#1 TheStudent555   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 06-February 19

Response From Ratchet PHP

Posted 21 April 2020 - 11:43 AM

I know Web Sockets are a different from HTTP, but I was wondering if one can receive a response from the server. For example, suppose client A sends data to client B. Can client A get a response from server? Would that be possible with Ratchet PHP. Could not find a concrete answer on this.
Is This A Good Question/Topic? 0
  • +

Replies To: Response From Ratchet PHP

#2 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2760
  • View blog
  • Posts: 8,066
  • Joined: 15-January 14

Re: Response From Ratchet PHP

Posted 21 April 2020 - 11:57 AM

A response from what server? If client A is talking to client B, where's the server in that?
Was This Post Helpful? 1
  • +
  • -

#3 Splashsky   User is offline

  • D.I.C Addict
  • member icon

Reputation: 9
  • View blog
  • Posts: 565
  • Joined: 25-August 13

Re: Response From Ratchet PHP

Posted 21 April 2020 - 11:58 AM

Any time you make a connection to any server, a response is sent. If you have control over the server, you have control over the response. You could absolutely use Ratchet, but depending on what you're trying to do you may not even need WebSockets.

If you're aware of Laravel and how awesome it subjectively is, you can use a package like Laravel WebSockets to get started quickly.
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich   User is online

  • 痛覚残留
  • member icon

Reputation: 4278
  • View blog
  • Posts: 13,565
  • Joined: 08-June 10

Re: Response From Ratchet PHP

Posted 21 April 2020 - 01:17 PM

View PostTheStudent555, on 21 April 2020 - 08:43 PM, said:

I know Web Sockets are a different from HTTP, but I was wondering if one can receive a response from the server.

No. The concept of request/response doesn't exist in WebSockets, it uses messages. Your business logic may result in a request/response-like setup, though.
Was This Post Helpful? 0
  • +
  • -

#5 Splashsky   User is offline

  • D.I.C Addict
  • member icon

Reputation: 9
  • View blog
  • Posts: 565
  • Joined: 25-August 13

Re: Response From Ratchet PHP

Posted 21 April 2020 - 01:19 PM

View PostDormilich, on 21 April 2020 - 01:17 PM, said:

No. The concept of request/response doesn't exist in WebSockets, it uses messages.

So it's UDP protocol? What would a use-case for this sort of system be?
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich   User is online

  • 痛覚残留
  • member icon

Reputation: 4278
  • View blog
  • Posts: 13,565
  • Joined: 08-June 10

Re: Response From Ratchet PHP

Posted 21 April 2020 - 01:24 PM

Nope, still TCP protocol.
Was This Post Helpful? 0
  • +
  • -

#7 TheStudent555   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 65
  • Joined: 06-February 19

Re: Response From Ratchet PHP

Posted 21 April 2020 - 02:08 PM

@ArtificalSoldier,

Client A sends data through a server (Ratchet web socket code is located) to client B.

@Dormilich

Thanks for the answer.
Was This Post Helpful? 0
  • +
  • -

#8 Ornstein   User is offline

  • D.I.C Head

Reputation: 105
  • View blog
  • Posts: 216
  • Joined: 13-May 15

Re: Response From Ratchet PHP

Posted 22 April 2020 - 03:35 AM

Just to confirm, in case we've run into any confusion over terminology here: The server can send data back to the client, sure.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1