Results 1 to 4 of 4

Thread: Sockets.... A few questions to help me understand.

  1. #1

    Thread Starter
    Addicted Member DigitalMyth's Avatar
    Join Date
    Nov 2002
    Location
    England..
    Posts
    169

    Sockets.... A few questions to help me understand.

    Hey,

    I'm using sockets to connect to MSN and log-in which is going v. well. My script currenly logs in and set the account active on the msn messenger server.

    Now i need to move everything to the next page. So i need to keep track of the socket that the account is loged in with.

    Here i need what i need to understand;

    Does sockets keep connected on the server until u close them?

    How do i get the socket number that the account is logged in with and bring it to the next page?

    doesn't the sockets only exist when the page is being processed? if so, how do i get them to stick around.


    Thanks alot

    Digitalmyth
    Digitalmyth

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Sockets.... A few questions to help me understand.

    I have done a bit of digging around. What you need is a persistent socket for each connection. From what I have seen, it is not particularly easy, this is because a socket is only good while a process is running.

    It is not however impossible - you would need make a server which will be able to handle multiple connections to MSN and keep them alive. You can then either have the server listen on TCP ports for connections from your client scripts.

    Here is an example of the logic:
    1. A master script / program runs on the server all the time. It listens on a kind of repeater port.
    2. The first time the client script connects, it connects to the server script using the repeater port.
    3. The server script services the clients request, i.e: logs them on to MSN, establishes a connection to MSN and keeps it.
    4. The server script chooses a new free port and sends this back to the client. This is the port they must connect to for future requests and can be used as an identification for their MSN connection.
    5. The server script kills the connection on the repeater port and re listens for other clients on the repeater port.
    6. The server also now listens on the new port given to the client for future connections from it.


    You'll need to use the PHP sockets extension for this and also allow a script to run indefinatley on your server, so it can listen to connections.

    In effect you will be creating a go between server between MSN and your client PHP script.

    Best of luck.

    P.s: I've moved this thread to the networking forum, because socket programming is quite similar on Unix / PHP and Windows, so maybe someone with some more experience in this kind of thing can help you further and give you some better suggestions
    Last edited by visualAd; Apr 5th, 2005 at 04:26 PM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    Member
    Join Date
    Mar 2005
    Posts
    43

    Re: Sockets.... A few questions to help me understand.

    Hello I've read this post and I was woundering what the possibilities are when you connect to the msn server??

    What can you do with it,??

  4. #4
    Member
    Join Date
    Mar 2005
    Posts
    43

    Re: Sockets.... A few questions to help me understand.

    boost :mike:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width