Java and Unix Domain socketsI am trying to get Java to open a UNIX domain socket
in order to interact with an existing piece of software.
I can;t find any reference to this in the Java docs,
at java.sun.com, or searching google.
Has anyone had any success in this area.
stuart
On Thu, 10 Jul 2003 11:44:14 +0100, Stuart Clayman wrote:
> I am trying to get Java to open a UNIX domain socket in order to
> interact with an existing piece of software.
>
> I can;t find any reference to this in the Java docs, at
> java.sun.com, or searching google.
Searching Google gives several hits, all of them saying bas...
java unix domain sockets ... or substituteI've googled for the terms java unix domain sockets, and it seems like
this cannot be done with plain Java (and its JSL) alone.
There are a few 3rd party libs (junixsocket & JUDS) which unfortunately
both need native libs, which is a non-starter for me.
My current approach is to use named pipes intead, where the server
blockingly reads on a "main" pipe (opened just like a plain file).
Clients first create a new pair of named pipes, and pass the names to
the server, who in response creates a new thread to communicate over
those pipes and serve client's task ...
Ruby Socket to Java SocketHello !
I have some problem trying to establish dialog between a Ruby
socket(client) and a Java server socket (java.net.ServerSocket).
Everytime I try to write on the server socket I get an "Invalid stream
header" error from the server...
s = TCPSocket.open("host", 9061)
s.write("test \n");
=> Error
Can someone give a little hint on how to start inthe right way on this ?
Thx a lot !
Seurdge
--
Posted via http://www.ruby-forum.com/.
Ok, I have experiment a lot and found that :
When the Java Server use :
in = requestSocket.getInputStream();
It wo...
Are Unix Domain sockets supported?I thought I read somewhere that version 1.5 was adding support for Unix
domain sockets. Has support been added as yet?
Joseph
...
Are Unix Domain sockets supported?I thought I read somewhere that version 1.5 was adding support for Unix
domain sockets. Has support been added as yet?
Joseph
...
Are Unix Domain sockets supported?I thought I read somewhere that version 1.5 was adding support for Unix
domain sockets. Has support been added as yet?
Joseph
Joseph Dionne <jdionne@hotmail.com> writes:
> I thought I read somewhere that version 1.5 was adding support for Unix
> domain sockets. Has support been added as yet?
I don't think so... at least, it doesn't appear in 1.5 API docs.
--
�ric Jacoboni, n� il y a 1415663773 secondes
Eric Jacoboni wrote:
> Joseph Dionne <jdionne@hotmail.com> writes:
>
>
>>I thought I read somewhere that version 1.5 was adding support for Un...
Java socket <-> Dolphin socket problemI am trying to prototype a Smalltalk client to connect to a Java server
app of mine. I am using a plain socket connection to send XML strings
back and forth between the client and server.
Based on the server output, I can tell that the server is getting the
XML and processing it correctly and sending the XML response as
expected, but for some reason I am getting no data in the readStream on
the Smalltalk side. This same test works from a Java client as
expected.
Here's the Smalltalk code:
|socket resp|
socket := Socket port: 10005 address: (InternetAddress fromString:
'...
Java Server Socket & C++ Client SocketHi,
We have a socket server app in Java and the client application in C++.
When we try to connect 60 clients simultaneously from C++ using
threads, only 55-56 connections are successfull, rest are not
connected(Connection refused error).
For one connection everything works fine. In server side each
connection is handled in seperate thread.
Is there anything else to be done?
The server code is as follows.
public class SocketServer
{
public static void main(String args[])
{
ServerSocket Server = null;
Socket clientSocket = null;
try
...
Client Termination With Java Sockets doesnt close socketHello, i have a simple client/server app using java sockets. If i
simply close the client window, the server doesnt detect if the socket
is closed. Here is all the ways ive tried to test for the closed
connection but none work.
----------------------------------------------------------------------
if(soc.isClosed() || !soc.isConnected() || soc.isInputShutdown()||
soc.isOutputShutdown()){
//socket is closed
}
----------------------------------------------------------------------
then i tried this:
--------------------------------------------------------------
try{
PrintWriter br = new ...
Client Termination With Java Sockets doesnt close socketHello, i have a simple client/server app using java sockets. If i
simply close the client window, the server doesnt detect if the socket
is closed. Here is all the ways ive tried to test for the closed
connection but none work.
----------------------------------------------------------------------
if(soc.isClosed() || !soc.isConnected() || soc.isInputShutdown()||
soc.isOutputShutdown()){
//socket is closed
}
----------------------------------------------------------------------
then i tried this:
--------------------------------------------------------------
try{
PrintWriter br = new P...
Java socket....Hi all,
I'm writing an application to interface a device ( industrial balance )
to a PC via TCP/IP... well the device acts as Server and my application
is a listening client.
Th client receive a single string
<stx>dd/mm/yyyy;hh:mm;0000000000;A;0000000000<etx>
that I read with... a method like this:
....
byte[] buffer = new byte[100];
int count = 0, offset = 0;
count = socket.getInputStream().read();
while (count > 0 && count != 3) {
buffer[offset++] = count;
count = socket.getInputStream().read();
}
String line = new String(buffer, 1, offs...
java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsExceptionHi,
I am new to DB2. I am getting this error while loading the DB2Driver. I
don't have any idea about where i might have gone wrong. please help
me.
Below is the stack trace.
Stack Trace:
java.lang.ExceptionInInitializerError:
java.lang.ArrayIndexOutOfBoundsException
at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method)
at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245)
at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Cla...
java socketI need to write a java program that is waiting till a socket client
connects to it, after a certain time, about 15sec the client will
disconnect or the java app will disconnect the client. Right after
that a new connection to the same port should be available that a
client could connect to it. However a client is connected it will
receive data from the java app.
My question is how can I initiate a socket server which is allways on
and wayting for a connection, as soon as the connection brakes up a
new session will be initiated.
Thanks in advance
Niko
Modern Analytics
info@ni...
Java JavaHave my first Open Source Linux Java Project.
Working on a second right now.
Coming out with a distro called OPEN*WINDOWS.
It will be at www.black-and-company.com
tab wrote:
> Have my first Open Source Linux Java Project.
> Working on a second right now.
>
> Coming out with a distro called OPEN*WINDOWS.
>
> It will be at www.black-and-company.com
>
Wasn't that the whole point of Lindows?
Oh, right, we didn't care for that either.
tab wrote:
> Have my first Open Source Linux Java Project.
> Working on a second right now.
>
> Coming out with a ...
Java in JavaIs it possible to download a Java app (applet etc?) and run it inside a
desktop Java app?
--
Dirk
http://www.transcendence.me.uk/ - Transcendence UK
http://www.theconsensus.org/ - A UK political party
http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff
Dirk Bruere at NeoPax wrote:
> Is it possible to download a Java app (applet etc?) and run it inside a
> desktop Java app?
>
Quite likely, but you won't necessarily get the same security model,
unless you were careful about it.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/&g...
java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)Hi All
I am having the torque3.1.jar and postgresql-7.4. I have compiled the new
jdbc driver called as postgresql.jar and have placed it in the lib
directory from where the ant scripts catch the jars. Whenever i try to
access through torque
gestList = BaseGestlistPeer.doSelect(new Criteria());
this error arises
java.lang.StringIndexOutOfBoundsException: String index out of range: 23
at java.lang.String.charAt(String.java:460)
at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653)
at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...
Client socket disconnection event not received on Server socket java .nioHi All
I question is as below
i am using java.nio package + win 2K + jdk1.4.1_02
I have a Server accepting socket connection and is configured
in Nonblocking mode.
-The server receives (selector) events (accept event)
when a client requests for a connection .
-The server is getting read and write events when
client wants to read and write
-The server gets a read event when the client disconnects
My only problem is that the Server is not getting any events
when the client disconnect due top network break down
for EX when the network connection breaks the client disconnects
but the serv...
Java socket readHi everybody,
I'm having problems with the following code:
InputStream hostIn = hostSock.getInputStream();
while (true) {
try {
iRead = hostIn.read(m_Buf);
}
catch (IOException ex1) {
System.out.println("Error on receive.");
}
if (iRead == -1) {
break;
}
m_HostRcv.add(new ByteArr( (byte[]) m_Buf.clone(), iRead) );
rcvSum += iRead;
}
This code works fine with Apache webservers. hostIn.read returns -1 if
there is nothing left to read. On IIS webservers the read method
simply blocks if there is nothing...
java support half-close in socket library?Hello.
java support half-close in socket library?
in linux , i used to use shutdown ( fd, SHUT_WR ).
if java support,which function do I have to use?
Have a day.
"somez72" <somez72@chollian.net> wrote in message
news:c4scnn$kmr$1@news1.kornet.net...
> Hello.
> java support half-close in socket library?
>
> in linux , i used to use shutdown ( fd, SHUT_WR ).
> if java support,which function do I have to use?
Java Sockets have dedicated methods for shutting down input or output on the
socket.
They are Socket.shutdownInput() and Socket...
Multiple Client Sockets, Single java program, connect to server socket, possible?Hi all,
I have a strange problem. I started work on software expecting that it
was possible to create many client sockets in a single instance of a
java program that connect to a single server where ever that maybe.
In this case I have a thread running that determines actions, and
multiple threads are generated depending on the determined actions...
each thread requires a connection to the same server.
My issue is, when I call accept() and the server socket waits for a
connection... it only returns and services one socket per instance of
the program at a time. The client recieves no indicat...
UNIX select() equivalent in Java for polling multiple socketsHi All,I am struggling to find any information on how Java can be made topoll multiple sockets in a single thread. In variants of UNIX this issimply done via the select() call.Can anyone provide any links to tutorials/information explaining howthis is done? I did come across information on the SocketChannel &Selector classes somewhere, but unfortunately I lost the link :( I doremember there was something particular about version 1.4 &onwards....Thanks all captain_oldfield wrote:> > I am struggling to find any information on how Java can be made to> poll multiple sockets in a s...
SSRT3627 Potential Sec. Vulnerability in Java VM (J2SE) and Java Secure Socket Extension (JSSE)-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-----------------------------------------------------------------
Source: HEWLETT-PACKARD COMPANY
SECURITY BULLETIN: HPSBUX0309-280
Originally issued: 15 Sept. 2003
SSRT3627 Potential Sec. Vulnerability in Java VM (J2SE) and
Java Secure Socket Extension (JSSE)
-----------------------------------------------------------------
NOTICE: There are no restrictions for distribution of this
Bulletin provided that it remains complete and intact.
The information in the following Security Bulletin should be
acted upon as soon as possible. ...
java.lang.Set with elements of type java.lang.SetRoughly I do something along the lines of:
Set set = new HashSet();
Set elem = new HashSet();
set.add(elem);
// now we change the elem and add it again to the set
elem.add(some object here);
set.add(elem);
I found out the hard way that 'set' may now contain
'elem' either once or twice, the reason being that
'elem.add()' changes the hashCode of elem such that
it is not noticed that it is in 'set' already on the
2nd 'set.add()'.
Question: What I would actually want is an
IdentityHashSet() set = new IdentityHashSet()
but this does not...
SSRT3627 Security Bulletin Rev.1-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-----------------------------------------------------------------
**REVISED 01**
Source: HEWLETT-PACKARD COMPANY
SECURITY BULLETIN: HPSBUX0309-280
Originally issued: 15 Sept. 2003
Last revised: 17 Oct. 2003
SSRT3627 Potential Sec. Vulnerability in Java VM (J2SE) and
Java Secure Socket Extension (JSSE) (Rev. 1)
-----------------------------------------------------------------
NOTICE: There are no restrictions for distribution of this
Bulletin provided that it remains complete and intact.
The information in the following Security Bulle...