|
-
Mar 28th, 2005, 07:06 PM
#1
Thread Starter
Addicted Member
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
-
Apr 5th, 2005, 04:19 PM
#2
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:
- A master script / program runs on the server all the time. It listens on a kind of repeater port.
- The first time the client script connects, it connects to the server script using the repeater port.
- The server script services the clients request, i.e: logs them on to MSN, establishes a connection to MSN and keeps it.
- 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.
- The server script kills the connection on the repeater port and re listens for other clients on the repeater port.
- 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.
-
Apr 14th, 2005, 01:23 AM
#3
Member
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,??
-
Apr 20th, 2005, 02:38 AM
#4
Member
Re: Sockets.... A few questions to help me understand.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|