Permalink
Browse files

Switched VMClient to use Unix domain sockets.

git-svn-id: https://fourtwosix.jira.com/svn/TXPETE/trunk@12394 e6edf6fb-f266-4316-afb4-e53d95876a76
  • Loading branch information...
1 parent 4b8440d commit d448ee9760b4716a5aa62783126d673c32816fa1 joel committed Jun 10, 2011
View
@@ -60,6 +60,13 @@
<systemPath>${basedir}/../lib/jython.jar</systemPath>
</dependency>
<dependency>
+ <groupId>org.newsclub</groupId>
+ <artifactId>junixsocket</artifactId>
+ <version>1.3</version>
+ <scope>system</scope>
+ <systemPath>${basedir}/../lib/junixsocket-1.3.jar</systemPath>
+ </dependency>
+ <dependency>
<groupId>net.sf.opencsv</groupId>
<artifactId>opencsv</artifactId>
<version>2.1</version>
@@ -3,29 +3,29 @@
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
+import java.io.File;
import java.io.InputStreamReader;
-import java.net.InetAddress;
import java.net.Socket;
+import org.newsclub.net.unix.AFUNIXSocket;
+import org.newsclub.net.unix.AFUNIXSocketAddress;
+
import com.lightboxtechnologies.io.IOUtils;
public class VMClient {
public static void main(String[] args) throws Exception {
- if (args.length != 2) {
+ if (args.length != 1) {
throw new IllegalArgumentException("incorrect number of arguments");
}
- // set up the socket
- final InetAddress addr = InetAddress.getByName(args[0]);
-
- // get the port
- final short port = Short.parseShort(args[1]);
+ final File socketFile = new File(args[0]);
Socket sock = null;
try {
- sock = new Socket(addr, port);
+ sock = AFUNIXSocket.newInstance();
+ sock.connect(new AFUNIXSocketAddress(socketFile));
DataInputStream in = null;
try {
View
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit d448ee9

Please sign in to comment.