vendredi 22 juillet 2016

Can server send response from a different process and socket?

After server, which is listening on port X, receives a request from the client, can it send response from a different process and a socket with sendto call. Please note that the client also sends request with sendto (server address) call.

Here are the steps:

  1. server opens a socket and binds it to IP address (a.b.c.d) and port (x)
  2. client opens a socket and binds it to IP address (k.l.m.n) and port (z) and sends request to server with sendto call.
  3. Server (in different process) opens a socket and binds it to IP address (a.b.c.d) and port (y)
  4. server sends response from above socket to client with sendto

Both client and server knows each other ip addresses and port numbers.

I am noticing that client does not receive response when server sends response from a different process. Otherwise, it does.

Aucun commentaire:

Enregistrer un commentaire