File tree Expand file tree Collapse file tree 5 files changed +23
-11
lines changed
main/java/com/pedro/rtmp/utils/socket
test/java/com/pedro/rtmp/utils Expand file tree Collapse file tree 5 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ allprojects {
51
51
}
52
52
}
53
53
dependencies {
54
- implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.8 '
54
+ implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.9 '
55
55
}
56
56
57
57
```
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ android {
25
25
26
26
dependencies {
27
27
implementation project(' :rtplibrary' )
28
- implementation ' androidx.constraintlayout:constraintlayout:2.1.3 '
28
+ implementation ' androidx.constraintlayout:constraintlayout:2.1.4 '
29
29
implementation ' com.google.android.material:material:1.6.0'
30
30
implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version "
31
31
}
Original file line number Diff line number Diff line change 3
3
buildscript {
4
4
ext. kotlin_version = ' 1.6.21'
5
5
ext. library_group = " com.github.pedroSG94"
6
- ext. version_code = 218
7
- ext. version_name = " 2.1.8 "
6
+ ext. version_code = 219
7
+ ext. version_name = " 2.1.9 "
8
8
9
9
repositories {
10
10
google()
Original file line number Diff line number Diff line change 17
17
package com.pedro.rtmp.utils.socket
18
18
19
19
import com.pedro.rtmp.utils.TLSSocketFactory
20
- import java.io.BufferedInputStream
21
- import java.io.IOException
22
- import java.io.InputStream
23
- import java.io.OutputStream
20
+ import java.io.*
24
21
import java.net.InetSocketAddress
25
22
import java.net.Socket
26
23
import java.net.SocketAddress
@@ -31,9 +28,9 @@ import java.security.GeneralSecurityException
31
28
*/
32
29
class TcpSocket (private val host : String , private val port : Int , private val secured : Boolean ): RtmpSocket() {
33
30
34
- private lateinit var socket: Socket
35
- private lateinit var input: BufferedInputStream
36
- private lateinit var output: OutputStream
31
+ private var socket: Socket = Socket ()
32
+ private var input: BufferedInputStream = BufferedInputStream ( ByteArrayInputStream (byteArrayOf()))
33
+ private var output: OutputStream = ByteArrayOutputStream ()
37
34
38
35
override fun getOutStream (): OutputStream = output
39
36
Original file line number Diff line number Diff line change
1
+ package com.pedro.rtmp.utils
2
+
3
+ import com.pedro.rtmp.utils.socket.TcpSocket
4
+ import org.junit.Test
5
+
6
+ class SocketTest {
7
+
8
+ @Test
9
+ fun `check tcp socket error with socket not connected` () {
10
+ val socket = TcpSocket (" 127.0.0.1" , 1935 , false )
11
+ socket.getOutStream().write(0 )
12
+ socket.getInputStream()
13
+ socket.close()
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments