mam taki problem korzystam z ponizszego skryptu:
Kod
<?php
// Set time limit to indefinite execution
set_time_limit (0);
ignore_user_abort( true );
// Set the ip and port we will listen on
$address = 'localhost';
$port = 10559;
// Create a TCP Stream socket
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
// Bind the socket to an address/port
socket_bind($sock, $address, $port) or die('Could not bind to address');
// Start listening for connections
socket_listen($sock);
while(true) {
$client = socket_accept($sock);
// Read the input from the client – 1024 bytes
$input = socket_read($client, 1024);
socket_write($client, $input.'::'.$output);
// Close the client (child) socket
socket_close($client);
}
socket_close($sock);
?>
// Set time limit to indefinite execution
set_time_limit (0);
ignore_user_abort( true );
// Set the ip and port we will listen on
$address = 'localhost';
$port = 10559;
// Create a TCP Stream socket
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
// Bind the socket to an address/port
socket_bind($sock, $address, $port) or die('Could not bind to address');
// Start listening for connections
socket_listen($sock);
while(true) {
$client = socket_accept($sock);
// Read the input from the client – 1024 bytes
$input = socket_read($client, 1024);
socket_write($client, $input.'::'.$output);
// Close the client (child) socket
socket_close($client);
}
socket_close($sock);
?>
ale niestety korzystac z niego moze tylko jedno polaczenie. mam apliakcje w delphi ktora laczy sie z tym socketem i chcialbym aby ona byla tylko polaczona i odbierala sobie potrzebne dane. a inny skrypt zeby przesylal te dane do socketa.
chodi o to:
skrypt przekazuje dane -> server socketowy - > aplikacja delphi
ma ktos jakis pomysl jak moge to rozwiazac ?