Hi,
Quick & simple question:
I have to send the next data to a socket in order to make a popup visible on
a windows machine..
TITLE Title of popup [enter]
TEXT Text in popup [enter]
POPUP [enter]
<?
$s=socket_raw_connect($host,$port,15,'TITLE Test \nTEXT Text in
popup\nPOPUP\n');
function socket_raw_connect ($server, $port, $timeout,$request) {
if (!is_numeric($port) or !is_numeric($timeout)) {return false;}
$socket = fsockopen($server, $port, $errno, $errstr, $timeout);
if(!$socket) { echo "Opening socket error"; exit(); }
sleep(10); #Wait for program... bug :-)
$put=fputs($socket, $request);
sleep(10);
fclose($socket);
}
?>
Now, I have tried the whole scala of \r \n \r\n \0x0a etc.. for \n but it
doesn't seem to work..
Anyone a bright idea???
Thanx in advance,
Marco 6 5624
Hi Marco,
I fail to see what a popup has to do with a socket.
Really.
Are you talking about browser-popup?
That aside: What do you mean by "doesn't seem to work?"
Is the socket not accepting connections?
You didn't create a socket on a port under 1024 on *nix without being root??
Do you get an error?
Does the whole thingy time-out?
Please provide us/me with a little more information.
Regards,
Erwin Moller
Ok.. Seems the information was too little :-)
here we go with a little more info:
A friend of mine as programmed a simple popup kind of thing.
I made a scheduler in PHP, but to assure we don't forget any todo-items I
thought it would be a nice feature to let this scheduler (running on LINUX
server with apache/PHP) send messages to (in this case) my windows machine.
(e.g: call php page with aid of crontab)
Now, this friend has a reputation with Delphi (pascal) and programmed a nice
little popup application.
To use it I have to connect to (if local) 127.0.0.1 port 12345 (with SSH /
putty raw connection) and after entering the Tilte of the popup, text and
the final POPUP command, I see a nice popup with the text I entered...
....
So the commands entered in the PUTTY window are quite simple:
TITLE Title of popup window
TEXT text in popup window
POPUP
Now what I have to do (in php duh..) is sending these commands to the
client..............
So my thought would be creating a socket to the (windows) machine with the
popup-thing running and send the commands..
But it just doesn't seem to work..
If anyone of you can help me out.. PLEASE!! :-)
Thanx in advance,
Marco
"Quarco" <do********@hotmail.com> schreef in bericht
news:41*********************@news.xs4all.nl... Hi,
Quick & simple question: I have to send the next data to a socket in order to make a popup visible on a windows machine..
TITLE Title of popup [enter] TEXT Text in popup [enter] POPUP [enter]
<? $s=socket_raw_connect($host,$port,15,'TITLE Test \nTEXT Text in popup\nPOPUP\n');
function socket_raw_connect ($server, $port, $timeout,$request) { if (!is_numeric($port) or !is_numeric($timeout)) {return false;} $socket = fsockopen($server, $port, $errno, $errstr, $timeout); if(!$socket) { echo "Opening socket error"; exit(); }
sleep(10); #Wait for program... bug :-) $put=fputs($socket, $request); sleep(10); fclose($socket); } ?>
Now, I have tried the whole scala of \r \n \r\n \0x0a etc.. for \n but it doesn't seem to work..
Anyone a bright idea???
Thanx in advance, Marco
"Quarco" <do********@hotmail.com> wrote in message
news:41*********************@news.xs4all.nl... Hi,
Quick & simple question: I have to send the next data to a socket in order to make a popup visible
on a windows machine..
TITLE Title of popup [enter] TEXT Text in popup [enter] POPUP [enter]
<? $s=socket_raw_connect($host,$port,15,'TITLE Test \nTEXT Text in popup\nPOPUP\n');
function socket_raw_connect ($server, $port, $timeout,$request) { if (!is_numeric($port) or !is_numeric($timeout)) {return false;} $socket = fsockopen($server, $port, $errno, $errstr, $timeout); if(!$socket) { echo "Opening socket error"; exit(); }
sleep(10); #Wait for program... bug :-) $put=fputs($socket, $request); sleep(10); fclose($socket); } ?>
Now, I have tried the whole scala of \r \n \r\n \0x0a etc.. for \n but it doesn't seem to work..
Anyone a bright idea???
A firewall blocking the connection? What port are you using?
BTW: I hope you're not writing an adware.
Seemed the app. expected a timout between the commands..
No, it is _not_ an ad aware whatsoever :-)
"Chung Leong" <ch***********@hotmail.com> schreef in bericht
news:nb********************@comcast.com... "Quarco" <do********@hotmail.com> wrote in message news:41*********************@news.xs4all.nl... Hi,
Quick & simple question: I have to send the next data to a socket in order to make a popup visible on a windows machine..
TITLE Title of popup [enter] TEXT Text in popup [enter] POPUP [enter]
<? $s=socket_raw_connect($host,$port,15,'TITLE Test \nTEXT Text in popup\nPOPUP\n');
function socket_raw_connect ($server, $port, $timeout,$request) { if (!is_numeric($port) or !is_numeric($timeout)) {return false;} $socket = fsockopen($server, $port, $errno, $errstr, $timeout); if(!$socket) { echo "Opening socket error"; exit(); }
sleep(10); #Wait for program... bug :-) $put=fputs($socket, $request); sleep(10); fclose($socket); } ?>
Now, I have tried the whole scala of \r \n \r\n \0x0a etc.. for \n but it doesn't seem to work..
Anyone a bright idea???
A firewall blocking the connection? What port are you using?
BTW: I hope you're not writing an adware.
"Marco" <dont_send{spam}[mps]@this.address[webmind.nl].please.com> wrote in
message news:41***********************@news.wanadoo.nl... Ok.. Seems the information was too little :-)
here we go with a little more info:
A friend of mine as programmed a simple popup kind of thing. I made a scheduler in PHP, but to assure we don't forget any todo-items I thought it would be a nice feature to let this scheduler (running on LINUX server with apache/PHP) send messages to (in this case) my windows
machine. (e.g: call php page with aid of crontab)
Now, this friend has a reputation with Delphi (pascal) and programmed a
nice little popup application. To use it I have to connect to (if local) 127.0.0.1 port 12345 (with SSH / putty raw connection) and after entering the Tilte of the popup, text and the final POPUP command, I see a nice popup with the text I entered...
... So the commands entered in the PUTTY window are quite simple: TITLE Title of popup window TEXT text in popup window POPUP
Now what I have to do (in php duh..) is sending these commands to the client.............. So my thought would be creating a socket to the (windows) machine with
the popup-thing running and send the commands.. But it just doesn't seem to work..
If anyone of you can help me out.. PLEASE!! :-)
Thanx in advance, Marco
"Quarco" <do********@hotmail.com> schreef in bericht news:41*********************@news.xs4all.nl... Hi,
Quick & simple question: I have to send the next data to a socket in order to make a popup
visible on a windows machine..
TITLE Title of popup [enter] TEXT Text in popup [enter] POPUP [enter]
<? $s=socket_raw_connect($host,$port,15,'TITLE Test \nTEXT Text in popup\nPOPUP\n');
function socket_raw_connect ($server, $port, $timeout,$request) { if (!is_numeric($port) or !is_numeric($timeout)) {return false;} $socket = fsockopen($server, $port, $errno, $errstr, $timeout); if(!$socket) { echo "Opening socket error"; exit(); }
sleep(10); #Wait for program... bug :-) $put=fputs($socket, $request); sleep(10); fclose($socket); } ?>
Now, I have tried the whole scala of \r \n \r\n \0x0a etc.. for \n but
it doesn't seem to work..
Anyone a bright idea???
Thanx in advance, Marco
For this kind of thing it makes much more sense for the client to poll the
server across port 80. That way your program would still work when there's a
firewall between the two.
Funny, thought of that last night myself :-)
Still, it was a nice learning-thing ..
Thanx all for your time..
Greetz,
Marco
"Chung Leong" <ch***********@hotmail.com> schreef in bericht
news:h4********************@comcast.com... "Marco" <dont_send{spam}[mps]@this.address[webmind.nl].please.com> wrote in message news:41***********************@news.wanadoo.nl... Ok.. Seems the information was too little :-)
here we go with a little more info:
A friend of mine as programmed a simple popup kind of thing. I made a scheduler in PHP, but to assure we don't forget any todo-items I thought it would be a nice feature to let this scheduler (running on LINUX server with apache/PHP) send messages to (in this case) my windows machine. (e.g: call php page with aid of crontab)
Now, this friend has a reputation with Delphi (pascal) and programmed a nice little popup application. To use it I have to connect to (if local) 127.0.0.1 port 12345 (with SSH / putty raw connection) and after entering the Tilte of the popup, text and the final POPUP command, I see a nice popup with the text I entered...
... So the commands entered in the PUTTY window are quite simple: TITLE Title of popup window TEXT text in popup window POPUP
Now what I have to do (in php duh..) is sending these commands to the client.............. So my thought would be creating a socket to the (windows) machine with the popup-thing running and send the commands.. But it just doesn't seem to work..
If anyone of you can help me out.. PLEASE!! :-)
Thanx in advance, Marco
"Quarco" <do********@hotmail.com> schreef in bericht news:41*********************@news.xs4all.nl... > Hi, > > Quick & simple question: > I have to send the next data to a socket in order to make a popup visible > on > a windows machine.. > > TITLE Title of popup [enter] > TEXT Text in popup [enter] > POPUP [enter] > > > <? > $s=socket_raw_connect($host,$port,15,'TITLE Test \nTEXT Text in > popup\nPOPUP\n'); > > function socket_raw_connect ($server, $port, $timeout,$request) { > if (!is_numeric($port) or !is_numeric($timeout)) {return false;} > $socket = fsockopen($server, $port, $errno, $errstr, $timeout); > if(!$socket) { echo "Opening socket error"; exit(); } > > sleep(10); #Wait for program... bug :-) > $put=fputs($socket, $request); > sleep(10); > fclose($socket); > } > ?> > > Now, I have tried the whole scala of \r \n \r\n \0x0a etc.. for \n but it > doesn't seem to work.. > > Anyone a bright idea??? > > > Thanx in advance, > Marco > > > >
For this kind of thing it makes much more sense for the client to poll the server across port 80. That way your program would still work when there's a firewall between the two.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Lisa Pearlson |
last post by:
Hi,
My php application (on Apache/Linux) needs to do the following:
The PHP script receives a request from a client (binary), asking for certain
records of data.
My PHP script loops through...
|
by: Manfred Braun |
last post by:
Hi All,
I am trying to understand the blocking method socket.Send().
The call blocks as expected, but does this mean, it returnes after the
underlying TCP layer got a confirmation, that the send...
|
by: nicolas ETIENNE |
last post by:
Hello,
I want to send through Socket a struct
So, i'd like to do, as I did before in C++, something like
send((void*)myStruct);
where myStruct is a struct with basic types
|
by: hazz |
last post by:
smtpClient.Send(message)
is causing me problems as per specifics in the trace below. Email is sent
but not without this error typically upon sending the second email, but
sometimes when running...
|
by: BuddyWork |
last post by:
Hello,
Could someone please explain why the Socket.Send is slow to send to the same
process it sending from. Eg. Process1 calls Socket.Send which sends to the
same IP address and port, the...
|
by: Buddy Home |
last post by:
There is two examples of code.
Example 1. Send and Receive within the same process. Put this code in a
console app called SendAndReceive and run the code.
using System;
using...
|
by: iwasinnihon |
last post by:
I writing a program that will send both a text/html document as well
as jpegs using winsock. My code works find for the text, but will not
work with jpegs. My code is below. What am I missing? ...
|
by: danfolkes |
last post by:
Hey Everyone, I am trying to send repeated messages from a "Node" to a
"Server". It works the first time I send the from the Node to Server,
but after that it either errors, or does not do...
|
by: gvijayaratnam |
last post by:
Hi All,
I have a fn prototype as follows
void print ( char *Buffer, usigned long bufferSize, int chunkSize );
This fn will accept binary file buffer and the buffer size and the chunk
size,...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |