[C#] How to connect MUS Phoenix Socket :'(

Results 1 to 5 of 5
  1. #1
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    [C#] How to connect MUS Phoenix Socket :'(

    Hello,
    Anyone know how to connect to MUS Phoenix Socket ?
    Please . Thank you :)


  2. #2
    The Omega Superfun is offline
    MemberRank
    Dec 2006 Join Date
    The NetherlandsLocation
    5,223Posts

    Re: [C#] How to connect MUS Phoenix Socket :'(

    Connect what? In any languange you can just dump a command to the mus port.

  3. #3
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: [C#] How to connect MUS Phoenix Socket :'(

    With a little bit of using google:

    Code:
    <?php
    
    function SendMUSData($header,$data=""){
    
    $ip = $variable_from_the_config;
    $port = $another_variable_from_the_config;
    
    $data = $header.chr(1).$data;
    
    if(!is_numeric($port)){ return false; }
    $sock = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
    socket_connect($sock, $ip, $port);
    
            if(!is_resource($sock)){
                    return false;
            } else {
                    socket_send($sock, $data, strlen($data), MSG_DONTROUTE);
                    
                    //You can use socket_recv to get the response from the server.
                    //socket_recv($sock, $buf, 2048, MSG_WAITALL);
                    //echo $buf;
    
                    return true;
            }
    
        socket_close($sock);
    }
    ?>
    Quote Originally Posted by Superfun View Post
    Connect what? In any languange you can just dump a command to the mus port.
    He means by PHP ofc.

  4. #4
    The Omega Superfun is offline
    MemberRank
    Dec 2006 Join Date
    The NetherlandsLocation
    5,223Posts

    Re: [C#] How to connect MUS Phoenix Socket :'(

    Quote Originally Posted by HillBilly View Post
    With a little bit of using google:

    Code:
    <?php
    
    function SendMUSData($header,$data=""){
    
    $ip = $variable_from_the_config;
    $port = $another_variable_from_the_config;
    
    $data = $header.chr(1).$data;
    
    if(!is_numeric($port)){ return false; }
    $sock = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
    socket_connect($sock, $ip, $port);
    
            if(!is_resource($sock)){
                    return false;
            } else {
                    socket_send($sock, $data, strlen($data), MSG_DONTROUTE);
                    
                    //You can use socket_recv to get the response from the server.
                    //socket_recv($sock, $buf, 2048, MSG_WAITALL);
                    //echo $buf;
    
                    return true;
            }
    
        socket_close($sock);
    }
    ?>

    He means by PHP ofc.
    Nothing of course about that, hell, the thread title has [C#]

  5. #5
    PHP & C# Developer Stevehabbz is offline
    MemberRank
    Nov 2011 Join Date
    244Posts

    Re: [C#] How to connect MUS Phoenix Socket :'(

    Wahaha , NVM THanks for the code HillyBilly !



Advertisement