-1

This is my first question on this site so I'll try to be as clear as possible.

We're building an EPP client to talk to Nominet EPP service. Nominet limits the sessions to be established by us to 5 sessions at a time. Source: http://registrars.nominet.uk/gtlds/gtld-registrar-systems/epp-gtlds

The problem that we're tackling here is we can't create a new socket every time the new Apache request comes in because of we might have 10 users that use this function at the same time.

What I'm thinking right now is we implement one script that creates 5 sockets and keeps them alive by sending hello command to Nominet occasionally (before the timeout, obviously). Then when the new process created by Apache, that process will use the exists sockets to send the command to Nominet.

The problem is I did a lot of research but can't find any way to do this, so I ended up looking for someone who knows more about this stuff.

Here is what I found but it's not what we want (not include some URL that I forgot to save while I was doing the research): PHP Threads Sharing a Central Socket Object

Anyone know how to implement the sharing socket schema? I would be more than appreciated if someone can help on this.

Also, if you know the solution in another language, please do tell. We're open for the new languages and architecture.

Thanks :)

  • How is your linked reference "not what we want"? It looks to me like that code should solve your problem, as described. – FKEinternet Jun 20 '17 at 03:46
  • The new Apache process will not have the access to server variable like the code in https://stackoverflow.com/questions/34143283/php-threads-sharing-a-central-socket-object does so we can't use it like that. Or maybe there is a way to do this but I don't know at the moment. – Patompong Savaengsuk Jun 20 '17 at 04:02
  • Maybe look into something like http://php.net/manual/en/intro.memcached.php. You will be able to share data across different apache processes using that. – Capsule Jun 20 '17 at 05:43
  • Thanks, Capsule. I'll have a look :) – Patompong Savaengsuk Jun 20 '17 at 06:21

1 Answers1

0

Just finally got it works, I use a socket to solve this problem. This is how:

Process A connect to Nominet and keep the connection alive. It also opens the listener at port X.

Process B (apache process) will send the XML to process A via socket port X, then port A will forward that to the opening socket to Nominet and send XML back to process B.