LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-26-2017, 10:49 AM   #1
packer59
Member
 
Registered: Oct 2017
Posts: 47

Rep: Reputation: Disabled
C/C++ : Instant messaging between two IPs ?


Hello,

I heard that there is a possible library for sending/receiving messages between two computers (ip addresses) using C/C++.

Would you know which library would do this?

Regards
 
Old 11-26-2017, 04:24 PM   #2
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
In Linux, it is the kernel; in Windows, it is WinSock.
 
Old 11-26-2017, 05:05 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Obligatory:

http://beej.us/guide/bgnet/

Last edited by dugan; 11-26-2017 at 05:08 PM.
 
1 members found this post helpful.
Old 11-27-2017, 02:56 AM   #4
camp0
Member
 
Registered: Dec 2016
Location: Dublin
Distribution: Fedora
Posts: 70

Rep: Reputation: 4
Is called "Socket programing"
 
Old 11-27-2017, 07:13 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
There's plenty of discussion of how to do this. One program opens a socket and waits to accept a connection on it. The other program connects. (The socket is minimally specified by an IP-address and a socket-number.)

It is also possible to use other libraries, such as TLS (formerly: SSL), which provides support for encrypted connections, such as the one your web-browser is right now using to talk to LQ. (See the "padlock" on the address-bar?) In general, I like to use existing high-level wrappers to do things. For instance, if you want to do "AJAX calls" in your C/C++ program (especially "C++"), you can Google-around (or GitHub around ...) for an existing library that will deal with this very-common requirement "soup to nuts."

Quote:
Originally Posted by A Wise Lazy-Programmer:

Actum Ne Agas: "Do Not Do A Thing Already Done."

Last edited by sundialsvcs; 11-27-2017 at 07:15 AM.
 
Old 11-27-2017, 11:14 AM   #6
packer59
Member
 
Registered: Oct 2017
Posts: 47

Original Poster
Rep: Reputation: Disabled
No need to reinvent the wheel. There was a little library for C/C++ that allows to sending/receiving messages from ip to ip, some 5-6 years ago in Linux. Which one could it be?
 
Old 11-27-2017, 12:37 PM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,842

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I don't think so. I guess you need to look for some examples or tutorials. You need to create a client-server application, probably using bidirectional communication.
 
Old 11-27-2017, 01:09 PM   #8
packer59
Member
 
Registered: Oct 2017
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
I don't think so. I guess you need to look for some examples or tutorials. You need to create a client-server application, probably using bidirectional communication.
maybe heard of nokia lib from im ?
 
Old 11-27-2017, 02:05 PM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by packer59 View Post
maybe heard of nokia lib from im ?
Now you are talking about specific applications and protocols, all of which would be built on the client/server/socket model to meet the requirements of the target protocols.

Perhaps it would be better if you would describe for us what, exactly, you are trying to achieve.

Please see the Site FAQ Welcome page, and links included there, for guidance in asking a more complete question so that others can provide help more specific to your requirements.
 
Old 11-27-2017, 03:55 PM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Yeah, what kind of information would go into these "instant messages" and what kind of program is going to send them?
 
Old 11-27-2017, 04:56 PM   #11
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
libpurple?
 
Old 11-28-2017, 01:11 AM   #12
packer59
Member
 
Registered: Oct 2017
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
libpurple is for chat (icq,...). With the above mentioned library, one could set a port e.g. 2222 and im directly to given ip's.
 
Old 11-28-2017, 06:24 AM   #13
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
Originally Posted by packer59 View Post
maybe heard of nokia lib from im ?
Nope. Perhaps you would like to share with the rest of the class?
 
Old 11-28-2017, 01:07 PM   #14
packer59
Member
 
Registered: Oct 2017
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ntubski View Post
Nope. Perhaps you would like to share with the rest of the class?
oh guys, no one? I can't remember the name of the package Hopefully someone will have a clue.
 
Old 11-28-2017, 02:38 PM   #15
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,223

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
The only Nokia library that anyone else knows about is Qt. Sorry.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Instant messaging at LQ? pixellany LQ Suggestions & Feedback 8 07-08-2010 01:09 PM
Instant Messaging thunyiwe Linux - Newbie 2 05-08-2008 07:35 AM
instant messaging arlothemoo Linux - General 2 08-19-2002 06:43 AM
instant messaging mmls Linux - Newbie 2 06-12-2002 01:39 PM
Instant messaging help Jasutinsama Linux - General 0 02-14-2001 11:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration