-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only one thing in ClientServerTests doesn't work currently. Maybe someone will find a fix in the future... smile I tried many things, even reimplementing the whole named pipes thing with JNA... But it boils down to read/write throwing an exception instead of returning -1... Since the read is done infinitely in a separate thread, it doesn't know when the output from server is done. So when a connection breaks, we should just ignore it, and not System.exit(1); as currently. Commits: * Try to fix client-server on windows * Use Files.readAllLines, bcoz java8 * Fix most of client-server tests on windows * Remove comments.. * Revert clientSocket.close() code Pull request: #1230
- Loading branch information
Showing
7 changed files
with
164 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
package mill.main.client; | ||
public abstract class Lock implements AutoCloseable{ | ||
abstract public Locked lock() throws Exception; | ||
abstract public Locked tryLock() throws Exception; | ||
|
||
public void await() throws Exception{ | ||
public abstract class Lock implements AutoCloseable { | ||
|
||
public abstract Locked lock() throws Exception; | ||
|
||
public abstract Locked tryLock() throws Exception; | ||
|
||
public void await() throws Exception { | ||
lock().release(); | ||
} | ||
|
||
/** | ||
* Returns `true` if the lock is *available for taking* | ||
*/ | ||
abstract public boolean probe() throws Exception; | ||
public abstract boolean probe() throws Exception; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
package mill.main.client; | ||
|
||
import java.io.RandomAccessFile; | ||
import java.nio.channels.FileChannel; | ||
import java.util.concurrent.locks.ReentrantLock; | ||
public interface Locked { | ||
|
||
|
||
public interface Locked{ | ||
public void release() throws Exception; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.