Hi all,

after a long time of being apsent I now reenter the ASMring!

I am trying to do something like an instant messager (correct spelling???) to exchange messages/files and to see who is only now (like ICQ hehe).

The realtime chat is no big deal, I have done that once and I can implement it into the new project.

BUT:
* How do I exchange complete messages, I mean, in what way? Should I just do them as text files and transder them that way or is there another way? How for example does Winpopup do that?
* How can I use a buddy list? Should I just add them manually to a config file with name and IP (IT IS JUST FOR MY LAN) and check then if the guy is online or not or is there a more elegant qay to solve it?

Has maybe anyone some source suggestions or is/has been working on something similar? I need to code something, cause it is boring on my boat otherwise.

Greets fly out to Bogdan, Hiro, Icz, Hutch and all those others from the old Win32asm board!

See you
Stefan Krause alias Yawns
Posted on 2001-11-23 13:29:21 by YaWNS
Welcome back :alright:
* How do I exchange complete messages, I mean, in what way? Should I just do them as text files and transder them that way or is there another way? How for example does Winpopup do that?


I'm not sure but I remember that winpopup uses WNet function, a set of network-independant functions, but you'll need normal winsock functions. It's best to create a simple communication prototocol for sending messages to clients.. for example:


1 DWORD containing some code that indicates the type of message (define some constants for this, say MSGTYPE_TEXT, MSGTYPE_URL or whatever you like).
1 DWORD containing the size of the following message
[message data]


Send this to the client and make the client recognize it as a message.


* How can I use a buddy list? Should I just add them manually to a config file with name and IP (IT IS JUST FOR MY LAN) and check then if the guy is online or not or is there a more elegant qay to solve it?


That's not a bad option but the problem will be checking if the person's online..You'll have to keep checking by trying to connect to the computer.. That's not very ellegant but it's possible for a local network. If you want to use it with the internet, your provider may see such a frequent connection attempt as port scanning.
ICQ uses a central server that tells each client when a user is online, what's it IP is based on it's nickname, etc..

Thomas
Posted on 2001-11-23 13:55:34 by Thomas
Hi Stefan

I missed you :)

On a local network you can try to use a broadcast message (IPX or UDP) to inform all other parts you are there, but you can not do this on internet because routers will stop you...

Best way to go on internet is UDP ... after handshake by TCP/IP but you have to make your own protocol on top of it ... and beware of firewalls...
Posted on 2001-11-23 20:35:48 by BogdanOntanu
Hello,

Winpopup uses something called a mailslot. Messages get stored and retrieved there. I think the message broadcast is limited only within workgroups and I also think it has a capacity limit.

http://www.anticracking.sk/EliCZ/export/Mailslot.zip -> an example using mailslots in c++

I haven't made a mailslot program before, but it looks good to use for a messaging system in a win LAN I'm not sure though if it is capable of file transfer. For the buddylist, just make a protocol (for logins, current status etc.) Thomas has the idea :)


I've worked on something similar, it uses TCP. It's only limited to communicate with other computers on the same C subnet (10.10.10.x) its on. To search for other program users it portscans the entire class C subnet it's on to check IPs with an open port 51 (the server port). The server receives messages the client sends em. I've stopped working on it and it still has many bugs, like I can't get getpeername function to work (help anyone?) so it can't determine what IP a message came from. I can send you the source if you want.


clip
Posted on 2001-11-23 23:59:06 by clip
You are going to have to invent your own high-level protocol for doing this, just like the others you mentioned (ICQ etc)

I have studied several protocols for several chat-type services, and one you may consider basing yours on if you wanna is the Yahoo! Messenger protocol (YMSG) or the older Yahoo! protocol (YCHT) ....


The former includes file transfer, voice, room invites and all kinds of other goodies, the latter has support for the above but it is implemented differently.

If you've never ever seen one of these protocols up close and ugly, you may want to look at http://venkydude.com and http://loopy.org for some pointers... Note that the venkydude site is aimed more toward VB programmers (ewww) but the description of the protocol is all I was pointing you at, so we can disregard the language and just look at the data itself as its independent of the language its been coded in...
Posted on 2001-11-30 10:02:11 by Homer