Qbasicnews.com

Full Version: xteraco messanger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
welp, i'm thinking about a messanger program, cause i wann learn how networking worx.. i know absolutely nothing about it. . .period, not a thing (coding wise anyhoo)

here's a copy paste of my plan file :bounce:

-------------------------------/how it should work
it should work by communicating directly with other
poeple connected... so it would kinda be like a
messanger program, where you log in and everybody
is in 1 big room. . . i dont have many friends, so it
shouldnt get that crowded, 1 room will be ok

the basic idea is
the software sends a signal out to a central server
(my server) and says who logged on... if bill types
a message, then that message is sent to my server, and
then my server sends it to jane and everyone else. . .
in theory, when the user loggs on, it sends a message
to my server, and the connecting all works on my
server, but i'm thinking there must be a way to
eliminate the serverthing and make it so it will work
w/out a server in the middle directing traffik

-----------------------------------/problems and concerns
1.how do i get the data to jane, how do i know if jane is
online? (when she logs on, program sends data to me)
2.if i can send data straight to jane, why have a central
server, why not let it be a direct thing, where user
logs on,and can see everybody on, and talk directly
instead of through a server
3.what does the data consist of. . .strings stored in vars?
4.what commands do i need to learn and where can i get
a list of them?
5.has somebody done this before? where's there src?

(additional notes)
i'm just now recalling a networking section in my a+
cert study, it mentiones a star network.. and the
illustration looks like a central computer (server)
with sevral lines coming out of it... and those
lines are connected to the other computers... so
my server idea, would be like a star network.. but
instead of having the computers in the room, they
would be all over the place.... hmm, so maybe
my dream of getting it to work w/out a server is a
dream that wont come true...




anyhoo, you can help if you wanna, i'm doing all the searching for info i have time for, but any help would be greatly appreciated Big Grin
Looks up a long list......... Yup, you know very little,. heh,. nether do I.....

Confusedhifty: to tell ya the truth, I knew nothing on how to make a calculator...

*Looks around*

Trile & error,.. tons of it.. >_<.. ^_^ but its worth it.. :wink:
sounds like a great plan! :bounce:

i havent worked much on it today, i did spend a little time lookin for some stuff in the docs that come w/ fb, but didnt find much that made me happy... but whatever, i'll figure something out
you should maybe google for beej's guide to network programming, that's an introductionary text on sockets, pretty well written, should get you started.

you could also use fbraknet, though this is normaly used for game stuff, you can easily build a nice im/chat system with it.

on your peer to peer thingy: without a server, how should the instance of the client on your computer know the ip adress of say bill you want to talk to? given that he has a dynamic ip adress of course. sure, he could send you the ip via another messanger ( icq, msn whatever ) but then again why would you want to write your own? Smile

i once wrote a small app that used a php site as the server. the client queried a php site from the server every 30 seconds that told him who is currently only plus the ip adresses. with that approach you don't really need a server on your own, just some webspace that has php. you then create a php script that

+ can be called like myscript.php?userlogin=1&name=Hans&ip?192.39.1.1 from your client, the script will then write your name and ip to the "currently online file"

+ can be called like myscript.php?getuserlist=1 and reads out the currently online file and sends that back to you.

+ can be called like myscript.php?userlogout=1&name=Hans this will delete your name/ip from the currently online file

of course you could also use a mysql database instead of a file which would ease it even more. to retrieve the content of a php site or call a script you would have to use the http protocol which is an ascii based protocol and thus easy to use ( if you figure out the correct header info *looks at z1re, bows* ).

summary:
+ google beej's guide to network programming
+ have a look at fbraknet ( afair it comes with a chat example )
+ consider having a phpscript-server if you don'T have a machine running at a fixed ip on your own.
i was layin in bed thinkin about the hole thing, and i could almost see the code .. .lol, anyhoo here's how i think it should work

ok, were using the main server here, so keep that inmind,

bill logs in, once he logs in, the software sends data to my server telling me his ip address, it also sends all txt data to my server, ok... jill logs in, and writes "hello world" that txt data gets sent to my server, and my server sends it to whoever else is logged in. . .so basically the program keeps a list of ip addresses to send the message to, and when it gets txt data BOOM the messages get sent out.... yaay for me. . . :bounce:
Quote:you could also use fbraknet, though this is normaly used for game stuff, you can easily build a nice im/chat system with it.

i lookd for it, where can i find fbraknet?
nm, i found it
Your theory will bog down the server. Assuming you end up with 5000 people signed on at once, all flat out messaging each other. That's quite a lot of bandwidth.

I wish to do this as well, and have dabbled with it in VB6 using WinSock. My suggestion is yes, have a central server. People log on, therefore submitting their IP address etc etc. Get their buddy list, which of course can be stored either on the server or a client has them (for up to date information, store it on the server) and check everyone qho is listed as online. Return that information to your client.

When messages are sent, your online list on the client view would have access to the buddy's IP addresses allready. Have all clients listening on a particular port, and send on the same port. to the buddy IP addresses. This data is technically protected under the privacy act and really shouldn't go through the server first.

I'm in on the project anyway, as long as it's VB. Smile A FB messenger client is probably not practical.

>anarky - Practical, I think.
a FB messenger client is as practical as C messenger client with the winsock 1.1 header ported you have more or less all the same power in winsock as C does. for the GUI you always have wx-c which would make gui stuff a lot easyer.
So? I don't know C, nor am I willing to learn it unless I get paid. I know VB and that's what I'll use IF i get on the project team.

>anarky - No C here, or in the name.