Search the Community
Showing results for tags 'socket_write'.
-
i have a code in c# and here use GetBytes(msg) for SSlStream.write, here send and received data correctly, here all work fine, now i want to make the same event in php, but here i cant see a SslSteam or similar(i think no problem, becouse i working with socket_connection, and i think SSL is only for security), now for compare i stop the code in c# for see what data is sending and try to convert in php, for send here, i can see a data byte{} in c# and with ` $message=unpack('C*',$message);` i can convert the string to byte[], comparing with c# value is the same so, here all is ok, my problem is when i try to write the request, becouse in SslStream.write accpet byte[] but socket_write no accept whe i try send ` socket_write($socket, '\n', strlen($message))` i have a error : socket_write() expects parameter 2 to be string and obvius is becouse socket_write() only accept string, but so.. as i can send my byte[], becouse the server only accept a byte[] please help me PD> my problem is how i can send the byte[], i dont know if can send eq socket_write($socket, $message[1], strlen($message)), or what is which is the right way, note please $message first is a string as the server only accept byte i use unpack for create a $message[] as byte/integer eq with 70 items, etc, here is ok, becouse comparing with my program in c# give the same value(same array), but now i need send this $message[], but i cant becouse $message now is a byte or integer[], and socket_write only aceppt string, please help me