Compare commits
10 Commits
5312bee9bc
...
b322a3f0b0
Author | SHA1 | Date | |
---|---|---|---|
b322a3f0b0 | |||
0bbff33fdd | |||
67cbfa4c64 | |||
cf95b2dab4 | |||
95969a857b | |||
58fe142f7c | |||
43c4f1511d | |||
b2b519a2c4 | |||
7352a74a12 | |||
5874b2aef1 |
@ -360,11 +360,11 @@ abstract class Protocol
|
|||||||
* Setup a session with a remote client
|
* Setup a session with a remote client
|
||||||
*
|
*
|
||||||
* @param SocketClient $client Socket details of session
|
* @param SocketClient $client Socket details of session
|
||||||
* @param Address $o If we have an address, we originated a session to this Address
|
* @param Address|null $o If we have an address, we originated a session to this Address
|
||||||
* @return int
|
* @return int
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function session(SocketClient $client,Address $o): int
|
public function session(SocketClient $client,Address $o=NULL): int
|
||||||
{
|
{
|
||||||
if ($o->exists)
|
if ($o->exists)
|
||||||
Log::withContext(['ftn'=>$o->ftn]);
|
Log::withContext(['ftn'=>$o->ftn]);
|
||||||
@ -395,17 +395,14 @@ abstract class Protocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
// We are an IP node
|
// We are an IP node
|
||||||
|
$this->optionSet(self::O_TCP);
|
||||||
$this->client = $client;
|
$this->client = $client;
|
||||||
// @todo This appears to be a bug in laravel? Need to call app()->isDownForMaintenance() twice?
|
|
||||||
app()->isDownForMaintenance();
|
|
||||||
$this->down = app()->isDownForMaintenance();
|
$this->down = app()->isDownForMaintenance();
|
||||||
|
|
||||||
switch (get_class($this)) {
|
switch (get_class($this)) {
|
||||||
case EMSI::class:
|
case EMSI::class:
|
||||||
Log::debug(sprintf('%s:- Starting EMSI',self::LOGKEY));
|
Log::debug(sprintf('%s:- Starting EMSI',self::LOGKEY));
|
||||||
|
|
||||||
$this->optionSet(self::O_TCP);
|
|
||||||
$rc = $this->protocol_init();
|
$rc = $this->protocol_init();
|
||||||
if ($rc < 0) {
|
if ($rc < 0) {
|
||||||
Log::error(sprintf('%s:! Unable to start EMSI [%d]',self::LOGKEY,$rc));
|
Log::error(sprintf('%s:! Unable to start EMSI [%d]',self::LOGKEY,$rc));
|
||||||
@ -420,14 +417,10 @@ abstract class Protocol
|
|||||||
case Binkp::class:
|
case Binkp::class:
|
||||||
Log::debug(sprintf('%s:- Starting BINKP',self::LOGKEY));
|
Log::debug(sprintf('%s:- Starting BINKP',self::LOGKEY));
|
||||||
|
|
||||||
$this->optionSet(self::O_TCP);
|
|
||||||
$rc = $this->protocol_session($this->originate);
|
$rc = $this->protocol_session($this->originate);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DNS::class:
|
|
||||||
return $this->protocol_session();
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Log::error(sprintf('%s:! Unsupported session type [%s]',self::LOGKEY,get_class($this)));
|
Log::error(sprintf('%s:! Unsupported session type [%s]',self::LOGKEY,get_class($this)));
|
||||||
|
|
||||||
|
@ -155,8 +155,7 @@ final class SocketServer {
|
|||||||
$r = new SocketClient($this->server);
|
$r = new SocketClient($this->server);
|
||||||
|
|
||||||
if ($r->hasData(30)) {
|
if ($r->hasData(30)) {
|
||||||
if (! ($this->handler[0]->{$this->handler[1]}($r)))
|
$this->handler[0]->{$this->handler[1]}($r);
|
||||||
exit(0);
|
|
||||||
|
|
||||||
// Sleep so our thread has a chance to pick up the data from our connection
|
// Sleep so our thread has a chance to pick up the data from our connection
|
||||||
usleep(50000);
|
usleep(50000);
|
||||||
|
Loading…
Reference in New Issue
Block a user