Created
November 28, 2017 15:34
-
-
Save asissuthar/03bf8ded648a7733d542aa09e592080a to your computer and use it in GitHub Desktop.
Send Data Using Broadcast Class
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
package in.asissuthar; | |
import java.io.IOException; | |
import java.net.*; | |
public class Main { | |
public static void main(String[] args) { | |
try { | |
Broadcast broadcast = new Broadcast(8080); | |
broadcast.client(); | |
byte[] data = "HELLO".getBytes(); | |
broadcast.send(data); | |
broadcast.close(); | |
} catch (SocketException socketException) { | |
socketException.printStackTrace(); | |
} catch (IOException ioException) { | |
ioException.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment