protected SocketConnection(final String protocol, final String host, final int port, final String message)
	throws ConnectionException {

		final byte[] recv = new byte[SocketConnection.RECV_BUF_SIZE];
		this.message = message;
		
		// Get the timeout value on the Socket
		socketTimeout = JBroFuzz.PREFS.getInt(JBroFuzzPrefs.FUZZING[0].getId(), 7);
		// validate
		if( (socketTimeout < 1) || (socketTimeout > 51) ) {
			socketTimeout = 7;
		}
		
		try {
			if (protocol.equalsIgnoreCase("https")) {

				// Make sure we have a factory for the SSL socket
				if (mSSLSocketFactory == null) {
					mSSLSocketFactory = Connection.getSocketFactory();
				}

				// Handle HTTPS differently then HTTP
				mSocket = mSSLSocketFactory.createSocket(host, port);
				mSocket.setSoTimeout(socketTimeout * 1000);

			} else {

				// Handle HTTP differently then HTTPS
				mSocket = new Socket();
				mSocket.connect(new InetSocketAddress(host, port),
						socketTimeout * 1000);
			}

			// Set buffers, streams, smile...
			mSocket.setSendBufferSize(this.message.getBytes().length);
			mSocket.setReceiveBufferSize(SocketConnection.RECV_BUF_SIZE);

			inStream = mSocket.getInputStream();
			outStream = mSocket.getOutputStream();

			// Put message on the wire
			outStream.write(this.message.getBytes());
			// Start timer
			final SocketTimer timer = new SocketTimer(this, socketTimeout * 1000);
			timer.start();

			// Read response, see what you have back
			final ByteArrayOutputStream baos = new ByteArrayOutputStream();
			int got;
			while ((got = inStream.read(recv)) > -1) {
				baos.write(recv, 0, got);
			}

			// If the timer is not reset, close() will be called
			timer.reset();

			baos.close();

			inStream.close();
			outStream.close();

			mSocket.close();

			reply = new String(baos.toByteArray());

		} catch (final MalformedURLException e1) {

			reply = "Malformed URL: " + e1.getMessage() + "\n";
			throw new ConnectionException(reply);

		} catch (final IOException e3) {

			reply = "An IO Error occured: " + 
			". \n\nThis could also be a Connection Timeout, " +
			"\ntry increasing the value under Preferences ->" +
			" Fuzzing\n";
			throw new ConnectionException(reply);

		} finally {

			IOUtils.closeQuietly(inStream);
			IOUtils.closeQuietly(outStream);

		}

	}