Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.pablo67340.textures;
- import java.io.IOException;
- import java.net.InetAddress;
- import java.net.ServerSocket;
- import java.net.Socket;
- import java.net.UnknownHostException;
- import com.pablo67340.main.Main;
- public class Webserver extends Thread
- {
- public Main ft = null;
- public boolean running = true;
- public Webserver(Main f) { this.ft = f; }
- public void run() {
- try {
- this.ft.Server = new ServerSocket(this.ft.port, 10, InetAddress.getByName("0"));
- }
- catch (UnknownHostException e1) {
- e1.printStackTrace();
- }
- catch (IOException e1) {
- e1.printStackTrace();
- }
- do
- {
- Socket connected = null;
- try {
- connected = this.ft.Server.accept();
- new WebHandler(connected, this).start();
- }
- catch (IOException localIOException1)
- {
- }
- }
- while (this.running);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement