Messaging System  
Author Message
briggins5





PostPosted: Visual Basic Express Edition, Messaging System Top

Hi

This may ahve already been done but i just thought how effective it could be. Instead of using the winsock control in a chat program use a database stored on a server where messages are stored. When someone sends a message the name of the recipient is logged and a query would then check if the recipients name matches the one the sender specified. Each user would have a unque name. I know it would not be a very secure way of sending messages but it would still be quite simple. If it is possible to do this could someone help me with the query part (I would use an SQL database).




Visual Studio Express Editions33  
 
 
Andreas Johansson





PostPosted: Visual Basic Express Edition, Messaging System Top

It has most likely been done before. If you have looked at the connections open when you chat with some one using MSN/Live Messenger you will see that it only has a connection to a microsoft server and not the other user directly. Messages are routed through a server, I have no clue if it stores it in a SQL server or not but the concept is similar

Send message:

Get/read message (to be done in a transaction)


To send a message you only need to insert it in a table but to read you should only get unread messages and mark those you get as read. To this in safe way I first select the unread message id's into a temporary table, update those as read and then select the data I need using the message id's in the temporary table.

This is only a suggestion, what suits you best might be different.



 
 
briggins5





PostPosted: Visual Basic Express Edition, Messaging System Top

Thanks. I am glad to know thatit is possibl.The concept of it is quite simple and the coding seems it as well. I cant see myself replcaing MSN though. thanks.