AOA Forums AOA Forums AOA Forums Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA Forums > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!


Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 19th December, 2002, 07:05 PM
loop's Avatar
Member
 
Join Date: December 2001
Location: Under bed with pan of water and 2 mines.
Posts: 866

Pascal chat program

Simple question
the feasibility of writing a very simple internet chat program that uses a centralised server in pascal.
Me and dave are gonna attempt it but we really need to know some basics about sending data over the internet, such as how do we do it.
__________________
Are you on drugs? If not should you be on drugs?
Warranties are there to invalidate.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 19th December, 2002, 07:09 PM
Member
 
Join Date: November 2001
Location: Rotherham, UK
Posts: 146

Ive got one working at the monent basicallty writing to a centralised file (when you open a new conversation it creates a new file for that convo) and then writing every second.

Its currently works but only ovewr the college network, saving ti a common drive.



im dubious about being able to do anything similar with pascal, for a start getting pascal to acknowledge the internet will take some doing, and then getting it to somehow create a file on my server :S


I think over the net we'll have to setup some sort of direct connection between the machines perhaps.
__________________
Dave - Spode's Abode

Dogs can never have too much fun! See Marge, Weee, weee, woo! wayhey! weeeeeeeee!!! -Homer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 19th December, 2002, 08:02 PM
loop's Avatar
Member
 
Join Date: December 2001
Location: Under bed with pan of water and 2 mines.
Posts: 866

yeah maybe pascal is too hopeful, but it looks very possible with C++, just got to learn C++, oh why must collge use such an old language.
__________________
Are you on drugs? If not should you be on drugs?
Warranties are there to invalidate.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 19th December, 2002, 09:27 PM
Chief Systems Administrator
 
Join Date: September 2001
Location: Europe
Posts: 13,075

Depending on who's Pascal compiler you are using, it may well be possible.

TCP/UDP connections (Internet) are handled by something known as "sockets". If you can import Win32 calls into the Pascal you are using, then you can use the WinSock library to do some of the dirty work for you.

The basic way that sockets work for the connecting machine is kinda like this...

You initalise the socket library.
You create a socket. You will receive a number that corresponds to the socket. Don't lose it!
You build up a connection descriptor out of the remote IP (not hostname!), the remote port, and the type of connection you want (Internet generally).
You call the Connect function.
With a little luck you'll get returned a connected message.

One thing to note though, is that socket operations do not necessarily block. That means you need to use something called "callbacks" in order to program sockets efficiently. A callback is simply where the Winsock library will call a routine in your program if something occurs (Such as data arriving).

There's some information on how to do it in Pascal over at http://www.aspelin.com/programming/winsock/

no idea if it'll work, but I've managed sockets programming in a few languages.

Áedán
__________________
Any views, thoughts and opinions are entirely my own. They don't necessarily represent those of my employer (BlackBerry).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 19th December, 2002, 09:29 PM
Chief Systems Administrator
 
Join Date: September 2001
Location: Europe
Posts: 13,075

Quote:
Originally posted by Dave
im dubious about being able to do anything similar with pascal, for a start getting pascal to acknowledge the internet will take some doing, and then getting it to somehow create a file on my server :S
If you're using a centralised server, then you probably don't want to be using files! (unless for audit/logging) Use memory buffers instead, as they're vastly quicker, more efficient, and don't churn up the disk.

Áedán
__________________
Any views, thoughts and opinions are entirely my own. They don't necessarily represent those of my employer (BlackBerry).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 20th December, 2002, 01:19 PM
Member
 
Join Date: September 2001
Location: Kent UK
Posts: 969
Send a message via ICQ to Rackne Send a message via AIM to Rackne Send a message via Yahoo to Rackne

Chat programs are evil. Currently writing one in Java for uni. The coding itself isn't evil at all. The fact that it's a group project with 11 other people is what makes it such a nightmare.

The fact that Java has socket classes built right in makes it very simple to program. If Pascal doesn't work out I'd say learn Java over C++. But then I have issues with C++. Horrid messy language.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's your chat program??? MrSeanKon OS, Software, Firmware, and BIOS 23 9th May, 2007 05:34 PM
Chat anyone? alexkerhead ThunderRd's AOA FOLDING@HOME Team 3 26th August, 2004 06:16 PM
Forum Chat? LP Forum Feedback and Suggestion Box 4 6th September, 2003 09:12 AM
Cat Chat Southern Man Random Nonsense! 0 29th November, 2002 06:05 AM


All times are GMT +1. The time now is 02:09 PM.


Copyright ©2001 - 2023, AOA Forums
Don't Click Here Don't Click Here Either

Search Engine Friendly URLs by vBSEO 3.3.0