Jump to content

Search the Community

Showing results for tags 'php socket'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 1 result

  1. This is my code to connect java socket:- ``` $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); socket_connect($socket, '', 12345); while(true) { // read a line from the socket $line = socket_read($socket, 1024, PHP_NORMAL_READ); var_dump($line); $someArray = json_decode($line, true); $otp = $someArray["otp"]; if($someArray["msg"] == "otp_generation") { $myObj = new \stdClass(); $myObj->msg = "OTP RECEIVED NEED TO CONNECT"; $send = json_encode($myObj); socket_send($socket, $send, strlen($send), 0); } exit; } ``` When connection is established successfully server send one OTP to client and received successfully in client. Then i send data to server OTP RECEIVED acknowledgement, it also received in server. After OTP RECEIVED acknowledgement server send welcome msg to client. I cant get the welcome message. if i remove the (exit) soket_write is not working i can't send data to server. if i put exit data send to server successfully and socket is closed. What can i do for this type of issue. I don't know what mistake i done.?
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.