krot

socket Connection: Close

Dec 1st, 2016
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $service_port = getservbyname('www', 'tcp');
  2. $address = gethostbyname('site.ru');
  3. $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
  4. $result = socket_connect($socket, $address, $service_port);
  5. $in = "GET /pop3.php HTTP/1.1\r\n";
  6. $in .= "Host: site.ru\r\n";
  7. $in .= "Connection: Close\r\n\r\n";
  8. socket_write($socket, $in, strlen($in));
  9. socket_close($socket);
RAW Paste Data