LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-28-2015, 05:37 AM   #1
intellectualBeard
LQ Newbie
 
Registered: May 2015
Posts: 1

Rep: Reputation: Disabled
Understanding the client-server architecture for implementation


Hello,

I found the introductory article on YouCompleteMe (http://www.alexeyshmalko.com/2014/yo...lugin-for-vim/) where the author mentions that it incorporates a client-server architecture, where seperate engines for various languages are there on the server side (https://github.com/Valloric/ycmd/blob/master/README.md).

I cannot understand the following:

Q. How does the query get generated and then sent to server? What is the protocol used there?

<General question: >
Q. How can a new C-library be used in a server?

I am trying to build a simple editor of my own in Java and wish to integrate another C-library with it without using a wrapper. I also wish to improve my understanding of the client-server model.

Any help will be appreciated.

Thanks in advance. Noob alert.
 
Old 05-28-2015, 07:21 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,886
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Client-Server architecture is that you have one element sending requests and receiving responses via a messaging protocol of some type, typically a network stack. That first part is the client. The client does not have to be running and ready all the time, it runs when needed, such as a user runs a program and looks for some type of data, then it issues it's requests to the server.

The server should be running all the time to be ready to provide responses to requests from one or more clients. The client-server model is such that the server should be capable of responding to multiple clients. The server can be on the same machine or on a different machine, or somewhere out in the Internet. In the article you've been reading, the server happens to be on the same machine. The model is the same though, the VIM client will issue requests to the server to satisfy it's needs to do auto-complete.

The query gets generated when the client software determines it is the right time or conditions to need information from the server to provide more auto-complete options. So it depends how the author wrote their client code. What protocol is used is also chosen by the author. In networking you can use raw Ethernet packets, or choose to use one of the common transports, such as TCP or UDP, and there are unassigned protocol port numbers within both of those transport protocol numbering schemes where the programmer can choose something unassigned. You'll have to read up on network protocols if you really wish a deeper understanding of it. These ports I'm talking about are just numbers in the protocol header which designate a type of communications. For instance there are port numbers assigned for communications types like FTP, TELNET, L2TP, and so forth. There are also many unassigned port numbers where the client-server author can choose one of those to communicate over the IP network and thus each side can be able to screen the IP traffic and find the packets relevant to this particular client-server session.

A new C library can be used in a server when you build the code which is the server and use this new library. It's not like you install or do something to an existing server and things are all set. When you talk about a code library, you really have to build the code, which is compile and link the code so that it will understand the new library. Also this new library needs to provide the proper, expected interfaces which were there in a former library, otherwise the build and link will not work.

I don't know how to integrate a Java app with a C library, or if that's even possible. Java is an interpreted language which uses a virtual machine to run the Java code you've written. Really not sure you can combine that with a C library. Perhaps someone else has thoughts on that.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Best NX client/server implementation? SilentSam Linux - Software 3 02-28-2013 03:20 PM
[SOLVED] How to design 1-tier client-server architecture using ubuntu edition(s)? rajiv yadav Ubuntu 4 01-19-2011 02:17 AM
Implementation of simple RADIUS client/server programs borganve Programming 0 08-27-2009 06:56 AM
Developing client server architecture through vb.net NEO1986 Programming 5 12-11-2007 01:27 PM
linux native IPsec architecture / implementation hishamiqbal Linux - Security 1 10-06-2004 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:19 PM.

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