मैं एक बहुप्रचारित PHP क्लाइंट लिख रहा हूं जो एक अपाचे रिवर्स प्रॉक्सी को https अनुरोध करता है और कुछ आंकड़ों को मापता है। मैं टीएलएस सत्र पुनरुद्धार के साथ प्रदर्शन में सुधार के बारे में एक स्नातक थीसिस लिख रहा हूं। अब मुझे अवधारणा का सबूत करने की ज़रूरत है जो इसे साबित/अस्वीकार करता है। फिलहाल मैं इस कोड है:PHP में टीएलएस सत्र पुनरुद्धार
$this->synchronized(function($this){
$this->before = microtime(true);
}, $this);
$url = 'https://192.168.0.171/';
# Some dummy data
$data = array('name' => 'Nicolas', 'bank account' => '123462343');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
),
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
"ciphers" => "HIGH:!SSLv2:!SSLv3"
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$this->synchronized(function($this){
$this->after = microtime(true);
}, $this);
$this->counter_group->write($this->before, $this->after, $result);
इस कोड को एक पूर्ण हाथ मिलाना करने के लिए काम करता है, लेकिन मैं कैसे php में एक फिर से शुरू करने के लिए हाथ मिलाना यह पता लगाने नहीं कर पा रहे?
किसी भी मदद की सराहना की जाएगी!
... या अस्वीकार करता है। :) – bishop
file_get_contents() अनुरोध के तुरंत बाद टीसीपी कनेक्शन बंद कर देता है ... आमतौर पर। एक हैंडल के साथ जीवित कनेक्शन हेडर और फॉपेन() की आवश्यकता है ... मुझे दुख की बात है कि अभी जांच करने के लिए पर्याप्त समय नहीं है: -/ – bwoebi