Created
September 17, 2022 23:11
-
-
Save PacodiazDG/22b964c47c6c024a5cc8d609375516c1 to your computer and use it in GitHub Desktop.
Socket client.kt
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
val socket = Socket("192.168.1.66", 8083) | |
val outputStream = socket.getOutputStream() | |
val dataOutputStream = DataOutputStream(outputStream) | |
println("Sending string to the ServerSocket") | |
dataOutputStream.write("CursorSet:0,0".toByteArray()) | |
dataOutputStream.flush() // Send Buffer | |
val inFromServer = BufferedReader(InputStreamReader(socket.getInputStream())) | |
val sentence = inFromServer.readLine(); | |
Log.i("TAGSsssss", sentence); | |
dataOutputStream.close() | |
socket.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment