Hello together,
I need to have a function in MT4 to send alerts out by UDP packet instead of email.
Can somebody help me please...
As far i know, it must use the WinApi...
Sending text in Java. Text should be the same as the content of the email.
// String host = "192.168.1.2"; int port = 4711;
public void send(String text, String host, int port) {
try {
// Get the internet address of the specified host
InetAddress address = InetAddress.getByName(host);
byte[] message = text.getBytes();
// Initialize a datagram packet with data and address
DatagramPacket packet = new DatagramPacket(message, message.length, address, port);
// Create a datagram socket, send the packet through it, close it.
DatagramSocket dsocket = new DatagramSocket();
dsocket.send(packet);
dsocket.close();
} catch (Exception e) {
System.err.println(e);
}
}
Thank you!
NicoleDeinhard
You can not customize parts of metatrader (like the change of email to udp)
NicoleDeinhard
You can not customize parts of metatrader (like the change of email to udp)Thank you Mladen... was not trading, sorry for my late replay... :-) Best regards Nicole
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello together,
I need to have a function in MT4 to send alerts out by UDP packet instead of email.
Can somebody help me please...
As far i know, it must use the WinApi...
Sending text in Java. Text should be the same as the content of the email.
// String host = "192.168.1.2"; int port = 4711;
public void send(String text, String host, int port) {
try {
// Get the internet address of the specified host
InetAddress address = InetAddress.getByName(host);
byte[] message = text.getBytes();
// Initialize a datagram packet with data and address
DatagramPacket packet = new DatagramPacket(message, message.length, address, port);
// Create a datagram socket, send the packet through it, close it.
DatagramSocket dsocket = new DatagramSocket();
dsocket.send(packet);
dsocket.close();
} catch (Exception e) {
System.err.println(e);
}
}
Thank you!