PICED Socket connections

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by jamie_t, Jul 17, 2007.

  1. jamie_t

    jamie_t

    Joined:
    Jan 6, 2005
    Messages:
    12
    Likes Received:
    0
    Hi,

    I'm trying to get some PICED logic to open a client socket through Socket I/O to a local server socket I've setup but PICED refuses to open a connection no matter what I try.

    I searched the forums and I found an old post saying all ports were blocked but then something about the possibility of opening the ports in the future. I then found posts about modifying some CTC firewall settings but I'd like to try the code out locally before updating a CTC.

    Is there something I can do inside PICED to open client sockets?

    Thanks,
    Jamie
     
    jamie_t, Jul 17, 2007
    #1
  2. jamie_t

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    The guru is on holiday this week.

    But...

    You don't make it clear - you want to open sockets in PICED and transfer this logic code to a CTC later?

    Or you want PICED to talk to a CTC via a socket?

    For PICED you should just be able to do it, make sure your firewall allows those sockets to be opened.

    For CTC there is a utility available which lets you open up a socket (in the network settings from memory). Socket ranges on the CTC are restricted, I think from memory the range is 20000 to 29999 or something like that.

    When you find the socket-opener-upper in the CTC it will tell you what the limits are.
     
    ashleigh, Jul 17, 2007
    #2
  3. jamie_t

    jamie_t

    Joined:
    Jan 6, 2005
    Messages:
    12
    Likes Received:
    0
    Hi Ashleigh,

    For the moment, I just want PICED to connect to a local socket server I've setup. I've setup a server app and it just sits there waiting for a connection. Unfortunately, PICED barfs after the OpenClientSocket command and no connection is ever made. No matter what port I use for both the server and PICED, I get Error number 4 "The connection could not be completed."

    Thanks,
    Jamie
     
    jamie_t, Jul 17, 2007
    #3
  4. jamie_t

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    Can you connect to the server using other software?
     
    Richo, Jul 17, 2007
    #4
  5. jamie_t

    jamie_t

    Joined:
    Jan 6, 2005
    Messages:
    12
    Likes Received:
    0
    Yep, I wrote a client app and it works no problem. The technology is .NET (I've used both v1.1 and 2.0 with no difference).

    Thanks,
    Jamie
     
    jamie_t, Jul 17, 2007
    #5
  6. jamie_t

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,420
    Likes Received:
    62
    Location:
    Adelaide
    It should just work... here's a snippet of code that works for me in PICED, talking to Slimserver running on another machine on my local network:

    In the initialisation bit :

    Code:
    OpenClientSocket('192.168.0.2', 9090); {open CLI connection to Slimserver}   
    
    then later :
    Code:
    if ClientSocketConnected then
      begin
        WriteClientSocket('login {username} {password}'#10); {need to login if security enabled}
        delay(0.2);
        {enable notifications, whatever we terminate this string with is what the server will terminate its replies with}
        WriteClientSocket('listen 1'#10);
      end;
    
     
    NickD, Jul 17, 2007
    #6
  7. jamie_t

    jamie_t

    Joined:
    Jan 6, 2005
    Messages:
    12
    Likes Received:
    0
    I tried putting the Socket server on remote machine (actually a Microsoft Virtual PC image) and it worked. When I move the server application back to the same machine as PICED, the errors occur again.

    It looks like PICED will not work with a local server application.

    Cheers,
    Jamie
     
    jamie_t, Jul 17, 2007
    #7
  8. jamie_t

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    Should not make any difference - local or remote, its all the same. It's not PICED, its something in your machine configuration.
     
    ashleigh, Jul 17, 2007
    #8
  9. jamie_t

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    What are you using as you host? 127.0.0.1 or localhost or <network ip>
     
    Richo, Jul 17, 2007
    #9
  10. jamie_t

    jamie_t

    Joined:
    Jan 6, 2005
    Messages:
    12
    Likes Received:
    0
    I tried both addresses, network IP and localhost. Neither worked.

    However, once I installed the Microsoft Loopback Adapter locally and used the IP address assigned to the Loopback adapter, I was able to get PICED working locally.

    Cheers,
    Jamie
     
    jamie_t, Jul 17, 2007
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.