Write the source code for messenger


 
Thread Tools Search this Thread
Top Forums Programming Write the source code for messenger
# 8  
Old 11-02-2006
Roger that dude !

Next time , I have to look better.I saw that pthreads is the solution I wanted.And your right man , my code just suck's , I have to code it better.

Oo.. But what about POSIX , u mention POSIX threads , what is this POSIX , on the another hand .

Cheer's ! Smilie
# 9  
Old 11-02-2006
pthreads means POSIX threads. POSIX is a standard which means that POSIX threads, among many other things, work the same way across many different UNIX and UNIX-like systems.

For the third time, I'd suggest simplifying the problem before you even begin to think about concurrency. Don't build a chat server, build a communication library. Build sets of tiny, tiny example programs; one pair where the server sends and the client recieves, another where the client sends and the server recieves, another where the client connects to what you name instead of anything builtin, etc. These don't have to be interactive, so you don't have to worry about user input and network input at the same time; you can get them working without worrying about threads. Once you perfect sending, recieving, and connecting, then you can put the puzzle pieces together in a multithreaded application.

I understand the temptation to skip all that and build a simple something without any framework, but when you get into it, these "simple" things inevitably become way more complicated than they first appear. If you don't break it down, you won't be able to understand what you've written after leaving it for a week.

Last edited by Corona688; 11-02-2006 at 12:08 PM..
# 10  
Old 11-02-2006
Your totaly right man ..

I want to make/write the code fast , but I forget about the simple things , which do the business.

Quote:
one pair where the server sends and the client recieves, another where the client sends and the server recieves, another where the client connects to what you name instead of anything builtin, etc.
I already practice , and make some examples of this one's Smilie And the good thing , after many tries , I understand the point. Smilie

I understand , how pthreads work , google it , and I can now just mofigy my source code and pthread it .

Smilie

EDIT : I finished to write the source code , for a multithreaded chat server , and it's working fine.Now I have to add more line's just for fun.

I have a question , how can I license , this software ( I want someting big ) , with GPL ? ( GNU ) , I saw many licensed source code .. Just a question Smilie

Last edited by !_30; 11-04-2006 at 07:20 AM..
# 11  
Old 11-26-2008
code in C in unix using threading

Can anyone send me the chat code in C in unix using threading in a single program.like we have to assume there is no server..plz.. i need it badly
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Source code

hii... i am a biginner....and i have linux source code ,downloaded from some website ,a compressed file on windows and dont know how do compile them..... (4 Replies)
Discussion started by: M K Raju
4 Replies

2. Shell Programming and Scripting

Source code compilation

Need assistance in Source code compilation . When installing a software compiling a source code . Whatever the output that prints on the screen i want to log it into a file. How can i see output and store the output to file ./configure make make install Is there other way of seeing output... (5 Replies)
Discussion started by: ajayram_arya
5 Replies

3. Linux

Source code

I need the source code of fedora. plz plz plz help me........... (1 Reply)
Discussion started by: neh
1 Replies

4. Shell Programming and Scripting

Block of code replacement in Java source code through Unix script

Hi, I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory. finally { if (null != hibernateSession && hibernateSession.isOpen()) { //hibernateSession.close(); } } It would be great if the script has... (2 Replies)
Discussion started by: hareeshram
2 Replies

5. UNIX for Dummies Questions & Answers

Where can i get unix source code?

Sir please tell me where can i get source code for some unix kernal and shell also. (1 Reply)
Discussion started by: VIPUL15
1 Replies

6. IP Networking

read/write,write/write lock with smbclient fails

Hi, We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Discussion started by: swatidas11
1 Replies

7. Shell Programming and Scripting

write page source to standard output

I'm new to PERL, but I want to take the page source and write it to a file or standard output. I used perl.org as a test website. Here is the script: use strict; use warnings; use LWP::Simple; getprint('http://www.perl.org') or die 'Unable to get page'; exit 0; ... (1 Reply)
Discussion started by: wxornot
1 Replies

8. UNIX for Dummies Questions & Answers

Where can I review the source code?

A very n00b question: After compiling and installing software, where does the original source code reside? I'd like to study the source code of some of the ports I've installed. Thanks! :D (1 Reply)
Discussion started by: Aaron Van
1 Replies
Login or Register to Ask a Question