LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 08-05-2011, 03:55 AM   #1
sanju.lnt
LQ Newbie
 
Registered: Aug 2011
Posts: 2

Rep: Reputation: Disabled
Question How to connect a java client to a BSD server using socket programming


Hi, Can any one help me to connect a java client to a BSD server using socket programming ( Loop Back )?

Is it is possible communicate between java process and linux process using MSGq's or Shared memory.

Last edited by sanju.lnt; 08-05-2011 at 03:57 AM.
 
Old 08-06-2011, 02:44 PM   #2
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Quote:
a BSD server
What service/process on this server do you wish to connect to? What have you tried so far, and why hasn't it worked? I've not known sockets to care about the difference between OSs involved on client and server.

Message Queues as in MQ/JMS? Sure, why not, just like both ends talking to any other persistance layer like a SQL RDBMS or a filesystem.
Java and shared memory, don't think so due to the JRE/VM. Probably going to need JNI/an Extension, or consider IDL/CORBA (can't use RMI if both ends aren't Java unless I'm mistaken).
 
Old 08-06-2011, 02:57 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -
Quote:
Can any one help me to connect a java client to a BSD server using socket programming
No sweat ! Sockets are sockets. Look up any "Hello world" tutorial on Java sockets programming, and you've got it.

Quote:
Is it is possible communicate between java process and linux process using MSGq's or Shared memory?
Short answer - no.

Longer answer - you might be able to find libraries or 3rd party products to allow Java programs to participate in SysV IPCs (e.g. SysV shared memory, message queues and semaphores). Or you can try writing your own (in JNI). But I wouldn't encourage it.

BTW, if you're not familiar with SysV IPCs, I strongly encourage you to check out Beej's Guide:

http://beej.us/guide/bgipc/output/ht...age/bgipc.html
 
  


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
running socket programming (client/server) on single computer rahb20 Linux - Networking 5 09-16-2008 11:09 PM
Java Server-Client programming question opioid Programming 1 11-30-2006 01:59 AM
cannot read data at server socket, though client socket sends it jacques83 Linux - Networking 0 11-15-2005 01:58 PM
how to implement fork() in socket programming b/w server/client in voice communicatio timeout4me Programming 1 08-05-2005 04:01 PM

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

All times are GMT -5. The time now is 02:42 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