C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-10-2008, 11:12 AM   #1
#C-help
 
Join Date: Jun 2007
Location: Las Vegas
Posts: 53
Forking Issue...

Hey guys. Long time no see. I was off the boards for about a year now. I hope I made some progress since last year(concerning C programming).

I wanted to write an Encrypted Chat System(p2p) and I did. But, I encountered major problems. To begin with, I know I should have used threading(not forking) for this...but I am learning threads now. I wanted to get this done faster and forking(with though less efficient) seemed to be the best way to do it(at least to me, it did). I managed to get it working, but the interface is messed up. It is very messy and it prints the messages in combination with the system messages.(they are all scrambled. I would be very thankful if you had the posibility to compile the program for me and see what I am talking about). I know I could use ncruses library to make an interface for it or even java(swing/awt)(IDK GTK), but I prefer to make it "pure" command line. So if there is any way to make the messages stay on sync and be arranged nicely...I would be very pleased.

Here is the source code: http://rafb.net/p/Gnb5jE30.html

I know there are some useless lines and the code is very bad...but I will organize it and remove the useless lines.
__________________
<<deleted because of colour and size abuse>>
cookie is offline   Reply With Quote
Old 07-10-2008, 04:46 PM   #2
FOSS Enthusiast
 
Join Date: Jun 2008
Location: Germany
Posts: 64
there are some issues with it.

First, I need the ECScrypt.h for compiling.
Second, for connect(), bind() and accept() the second argument is a struct sockaddr* so you need typecasting.
In your case it'd look like this:
Code:
connect(clisock, (struct sockaddr*)&clisock_addr, addrlen)
For the other two, the typecasting is (of course) the same.
mkruk is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some weird issue. dbzx C Programming 7 04-12-2009 04:10 PM
float calculation issue George2 C# Programming 1 05-26-2008 04:56 AM
type safe issue George2 C++ Programming 4 02-12-2008 09:32 PM
[Beginner Thread] Issue with "string" handling and memory leaks mas0 C++ Programming 8 01-17-2006 05:39 PM
my first issue of GDM DavidP A Brief History of Cprogramming.com 0 09-12-2002 04:02 PM


All times are GMT -6. The time now is 05:40 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22