Sending messages from php to C++ application via UDP socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello,

I am a first-time poster. I hope this is the proper way to ask my question:

I have a C++ media player application that I want to control via a php
website.
To that end the application has an UDP socket listening for Player
messages.
In C++ player messages have the following members:

class MessageHeader
{
	UINT16		packetSize;		// size of message in bytes
including header
	UINT16		sequenceNum;	// sequence number of message
	UINT16		flags;		// flags
	UINT16		msgType;		// msg type
}

class PlayerCommand : public MessageHeader
{
	WCHAR command[MAX_PATH]; 		// dynamic string
}


The php website is supposed to create an UDP socket in order to send player
commands (play, stop, next, etc.)
However, according to the documentation all php socket functions only take
messages in string format.
For example, int socket_sendto ( resource $socket , string $buf , int $len
, ....


My question is this:
If it is possible at all, how can I create a $buf - string that represents
the PlayerCommand class and is accepted by the C++ listening socket?


Thank you for your time!


Best Regards,
Christian Schlager

Carl Zeiss AG
Standort Jena/Jena location
Geschäftsfeld Planetarien/Planetarium Division
Softwareentwickler/Software developer

Phone : ++49 (3641) 64-2575
e-mail: schlager@xxxxxxxx

---------------------------------------- 
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.  

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux