Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Help with an IM program, running into some problems.

Author
Message
Clbembry
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 14th Oct 2008 03:30 Edited at: 14th Oct 2008 03:37
Ok, to start things off, I'm making an Instant messaging program. I've got the basic idea of how it would work (correct me if I'm wrong).

The idea is whenever I type in a string, it uploads it to a folder and the other person is constantly checking for that string. When it sees that the string is there it downloads it and reads the file in their program. The same goes for them, the upload a file and I constantly check for it and when it is there, I download it and read it.

So far what I've gotten is:



That's what I have for the sending part of the program, which is where I encounter my first error. Everything is getting uploaded right, but when I check the text inside the file on my server, it says a string that I had typed earlier on, not the one I just uploaded.

An example is I upload "Hello world", then a couple others and close the program. If I then come back open the program and type new strings, the first three files I upload will have the "Hello world" then the others and after all of the previous ones it starts showing my recent ones. I think this is due to not clearing the entry buffer in the right way? Or is it something else.


The next problem I'm having is checking for the files they uploaded. I just have no idea how to do it right. I tried using this:



Not only does the above cause the program great lag, it doesn't do anything! Anyone got any ideas?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Oct 2008 20:32
I don't see where your code knows the name of the file to get. You create the text file prefixed with "1", but you're retrieving a file that's prefixed with "2". This is also a poor way of doing an "instant" messenger program. If you don't want to have a sever in the middle of the clients, then you should form a peer-to-peer connection rather than continuously querying for a file on an FTP server.


Clbembry
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 19th Oct 2008 02:56 Edited at: 19th Oct 2008 02:57
I don't think you understand. When the other person uploads a file it has the name "2"+how many they have sent. Each time you receive a file it increases it so it looks for the next one.

This program is only meant for two people, so isn't it already peer to peer?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Oct 2008 23:33
Quote: "peer to peer"


Not if you're using an FTP server as a middle man. Is the other client running the FTP server itself? I guess I'm still not getting how exactly your system works.


Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 20th Oct 2008 00:42
take cls out of loop


www.freewebs.com/outscape
Clbembry
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 20th Oct 2008 03:13
Quote: "

Not if you're using an FTP server as a middle man. Is the other client running the FTP server itself? I guess I'm still not getting how exactly your system works.

"


So two people both have the same program. One person invites the other one and whenever they send a message it uploads it with a 1 followed by how many they've sent.

The other person sends messages that start with a 2. The first person looks for the latest message with a two and gets it. the second person looks for the latest message that starts with a one.

And how would taking the cls out of the loop do anything?
Xenocythe
19
Years of Service
User Offline
Joined: 26th May 2005
Location: You Essay.
Posted: 20th Oct 2008 04:33
Your concept is... nice... but it's not nearly as efficient as using a plugin like tempest or multisync for peer-to-peer instant messaging directly connected to one another, and sending each chat string to each other via the plugin.

See, when your both sending and receiving to the FTP server, that makes the FTP the middle man. This is not a peer-to-peer connection, it's a peer-server-peer... and it's an FTP server.

I would, in fact, use the newest multisync plugin for an instant messaging program and have it as a peer-server connection. Not FTP server, but a host server for direct internet connections as multisync is set up to do.

I have a lot of ideas and concepts for all sorts of programs, like most people. I'll tell you, if the day was only twice as long... endless possibilities.

3.11 We do not tolerate posts made for the purpose of putting down another forum member, group of members, religion, our company, our staff or any of our moderators, past or present.
Clbembry
17
Years of Service
User Offline
Joined: 10th Dec 2006
Location: Minnesota
Posted: 21st Oct 2008 00:36
Hmm... I didn't know about the multisync plugin. I'm going to look into it now. Thanks for the help.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Oct 2008 21:56
Quote: "I'll tell you, if the day was only twice as long... endless possibilities"


Then the kids would be awake twice as long and I'd be twice as tired.


Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 23rd Oct 2008 01:10
Quote: "Then the kids would be awake twice as long and I'd be twice as tired."


And then you would sleep twice as long and be twice as well rested.

Indicium
16
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 23rd Oct 2008 19:25
I Really wouldnt be able to sleep for twice as long

Login to post a reply

Server time is: 2024-11-24 19:40:37
Your offset time is: 2024-11-24 19:40:37