mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Merge branch 'master-MC1.8.9' of github.com:MightyPirates/OpenComputers into master-MC1.9.4
This commit is contained in:
commit
792331ba77
@ -267,7 +267,7 @@ object InternetCard {
|
||||
|
||||
@Callback(doc = """function([n:number]):string -- Tries to read data from the socket stream. Returns the read byte array.""")
|
||||
def read(context: Context, args: Arguments): Array[AnyRef] = this.synchronized {
|
||||
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(1, Int.MaxValue)))
|
||||
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(0, Int.MaxValue)))
|
||||
if (checkConnected()) {
|
||||
val buffer = ByteBuffer.allocate(n)
|
||||
val read = channel.read(buffer)
|
||||
@ -392,7 +392,7 @@ object InternetCard {
|
||||
|
||||
@Callback(doc = """function([n:number]):string -- Tries to read data from the response. Returns the read byte array.""")
|
||||
def read(context: Context, args: Arguments): Array[AnyRef] = this.synchronized {
|
||||
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(1, Int.MaxValue)))
|
||||
val n = math.min(Settings.get.maxReadBuffer, math.max(0, args.optInteger(0, Int.MaxValue)))
|
||||
if (checkResponse()) {
|
||||
if (eof && queue.isEmpty) result(Unit)
|
||||
else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user