Syllable Forum Index Syllable
Syllable Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

C++ Socket coding
Goto page 1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop
View previous topic :: View next topic  
Author Message
kasbah



Joined: 15 Sep 2007
Posts: 75

PostPosted: Wed Oct 24, 2007 7:01 am    Post subject: C++ Socket coding Reply with quote

I'm trying to write a native Syllable GUI IRC Client.

Now i wonder: do i have to use the BSD socket C API?
As i want to learn C++ and don't want to use this C-style API, i wonder again:
Is there any C++ socket API in syllable and i did not find it?
Would it be a good decision to try to use the C++ socket library from http://www.alhem.net/Sockets/index.html?

Maybe any other recommendations?

Thanks
Back to top
View user's profile Send private message
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Wed Oct 24, 2007 9:44 am    Post subject: Reply with quote

There is no C++ Sockets API in Syllable currently. We plan to add one when we write libnet, but right now you have to use the C BSD sockets API or import a 3rd party library to your own application.
Back to top
View user's profile Send private message Send e-mail
Kaj
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 2204
Location: Friesland

PostPosted: Wed Oct 24, 2007 10:27 am    Post subject: Reply with quote

Alas, that library is GPL instead of LGPL, so we can't use it for a system library.
Back to top
View user's profile Send private message Visit poster's website
kasbah



Joined: 15 Sep 2007
Posts: 75

PostPosted: Thu Oct 25, 2007 1:10 am    Post subject: Reply with quote

Ok, thank you for the informations.

I tried to use this library but it didn't work for me. Probably my lack of C++ skills. Anyway, i'm using the old C API for now, until Syllable gets a C++ API. Smile

But, not that i want you to integrate that library into Syllable, only to get it right:
The library is GPL, the system (Syllable) is GPL and LGPL. As long as you release the source of any changes you apply to the library and don't change the license of that source, you could integrate it, couldn't you? So why would you violate the GPL when integrating this library into Syllable?
Back to top
View user's profile Send private message
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Thu Oct 25, 2007 2:20 am    Post subject: Reply with quote

Using the GPL on a system library would force any application that linked against it to also use the GPL, which would be a little unfair. With the LGPL that doesn't happen, so we will only use LGPL for system libraries. You can't take GPL code and re-license it under the LGPL, either.
Back to top
View user's profile Send private message Send e-mail
stodge



Joined: 12 Oct 2007
Posts: 16

PostPosted: Fri Oct 26, 2007 7:53 pm    Post subject: Reply with quote

[quote="Vanders"]Using the GPL on a system library would force any application that linked against it to also use the GPL, which would be a little unfair. With the LGPL that doesn't happen, so we will only use LGPL for system libraries. You can't take GPL code and re-license it under the LGPL, either.[/quote]

You can relicense a new release of GPL code under a different license if you're the owner of that code of have the permission of all contributors. I think, from what I've read.
Back to top
View user's profile Send private message
kasbah



Joined: 15 Sep 2007
Posts: 75

PostPosted: Sat Oct 27, 2007 1:44 am    Post subject: Reply with quote

d'oh!
I did forget, that you need to release everything, that is linked against a GPL Library, under GPL.
Thanks Vanders for the hint.
And of course i must appreciate the decision to use only LGPL for system libraries as a good one. Smile

stodge, of course you can release your code, that means if you are the author - originator of every single line, under any license you want. You can even release it under more than one license at the same time and give the user the choice, which one to use, e.g. as mysql does or some other big companies. Even the library we are talking about, is licensed under a second commercial license the same time, so you can buy a commercial license for it, if you don't want to release your source under GPL but want to use the library.
Back to top
View user's profile Send private message
kasbah



Joined: 15 Sep 2007
Posts: 75

PostPosted: Wed Oct 31, 2007 5:20 pm    Post subject: Reply with quote

Okay. Smile
A small really really simple console "irc client" is done.
Please keep in mind that i'm new to C/C++, so everthing is a little bit harder for me.

Now i have created a GUI with basicly 2 TextViews and a Button. If the button is pressed, the Window Handler copies the text from TextView 1 to TextView 2. So far, so good. Now, of course, i want to add the socket code i've written but i don't know where and how. My goal for now is to get the incoming data from the socket copied into TextView 2 and to send the Value of TextView 1 to the socket, when the button is pressed.

As far as i have understand what i've read yet i have to create a new Looper executing the socket code and Sending a Message to the Window, when data is incoming at the socket, don't I? How woulld i do that? Maybe there is a simple application doing something similiar where i can read the source to see how it can work?

Thanks for the help.

P.S. The StringView is incomplete? I can't set the Alignment? If i try to call the SetAlignment() Method, the linker complains about a reference to nowhere and in the /sys/appserver/libsyllable/gui/stringview.cpp i can't find that method, only it's definition in /sys/include/gui/stringview.h. Did i get that right?

P.P.S Syllable needs more documentation for the API! Wink It is very hard for me to get simple things working. Sad
Back to top
View user's profile Send private message
cipri
Guest





PostPosted: Thu Nov 01, 2007 8:19 am    Post subject: Reply with quote

why don't you take a look at sIrc? As I remember Cox (or something similar) has written a very basic and easy to understand irc. If you google a little for "sIrc syllable" i think you will find it.
Back to top
Jonas



Joined: 18 Oct 2007
Posts: 55

PostPosted: Thu Nov 01, 2007 12:35 pm    Post subject: Reply with quote

You can find some sample code how to create and communicate with a Looper on my website (www.jarvoll.se/syllable).

/Jonas
Back to top
View user's profile Send private message
Vanders
The Knights of Syllable


Joined: 14 Sep 2007
Posts: 849

PostPosted: Thu Nov 01, 2007 2:57 pm    Post subject: Reply with quote

The upcoming Syllable Developer Newsleter #2 will also include the second part in my tutorial, which just happens to cover the basics of Loopers, Handlers and message passing.
Back to top
View user's profile Send private message Send e-mail
kasbah



Joined: 15 Sep 2007
Posts: 75

PostPosted: Thu Nov 01, 2007 6:07 pm    Post subject: Reply with quote

Thanks for the quick answers! Smile

cipri, easy, because i didn't know that it exists. When i noticed the existence of syllable some weeks ago the website was down, so i don't know what happend before the crash of the server as i never saw it. I saw the lightening boot time and thought: "I MUST have it!" Wink I do know what i can read on the new site. On the other hand, after searching for it i found some forum posts in the old forum via google cache and the website where sIrc was hosted in the google cache, as it dosn't exist anymore. No way to get the source of it for me.

Jonas, nice one! I still have to take a closer look on it, to understand it, though. Wink

Vanders, i read that in the first Developer Newsletter, but i want to write my code NOW!1!!1! Wink So i have to take the hard tour, not the easy one with your tutorial. I'm really looking forward to the second Newsletter. Smile

P.S. Maybe one of the Moderators or the Admin could change the topic title to "Writing an IRC Client" or something similiar, so that others can find this thread more easily?
Back to top
View user's profile Send private message
kasbah



Joined: 15 Sep 2007
Posts: 75

PostPosted: Sun Nov 04, 2007 10:48 am    Post subject: Reply with quote

Hahaha, the damn butugly irc client is working! Smile
now i got the boring part of fixing bugs and makeing it useable. Wink

thanks for your help again. Smile

[url=http://sourceforge.net/project/screenshots.php?group_id=209512]screenshot at sourceforge[/url]


Last edited by kasbah on Tue Nov 06, 2007 1:44 am; edited 2 times in total
Back to top
View user's profile Send private message
cipri
Guest





PostPosted: Sun Nov 04, 2007 12:41 pm    Post subject: Reply with quote

Some time ago I also intended to write a irc-client but I lost interest because there is no confortable possibility of geting a well formated graphical output ( different colors, differents sizes, bold, pictures, smilies...and so on).
I have seen a irc-client based on webkit and it looks great, so perhaps we will have some day something like a "webkit-view".
Some time ago I tried irc-client rhapsody and it works on syllable, you can find it on sourceforge, if you need some "inspiration".

I appreciate your effort for syllable, sadly there are not more people like you that try to help syllable. I really hope that you won't get frustated and stop developing goIrc so that it is more user-friendly. The autor of sIrc also just made the basics of an irc-client and than he didn't put any more effort in it.
Back to top
new123



Joined: 19 Oct 2007
Posts: 17
Location: Nilton

PostPosted: Sun Nov 04, 2007 1:26 pm    Post subject: Reply with quote

Good work! Smile
________
[URL=http://www.honda-wiki.org/wiki/Honda_CB250_G5]Honda CB250 G5 history[/URL]


Last edited by new123 on Tue Feb 01, 2011 5:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Syllable Forum Index -> Syllable Desktop All times are GMT - 6 Hours
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group