اخواني اﻻعزاء السلام عليكم
الرجاء من يستطيع مساعدتي ﻻ يبخل علينا
حقيقة عندي برنامج سأستخدمة ﻹجراء تجارب على الشبكات ولكن استخدام البرنامج سيكون أسهل عندما يكون بواجهة فيها ازرار وقوائم وحقول نصيه
لهذا أردت تحويل برنامجي لكي يسهل على استخدامه فمن منكم يتكرم ويساعدني سأدعي له عن ظهر القلب
وهذا هو برنامجي
import java.net.*;
class Client1
{
public static void main (String args[]) throws IOException
{
InetAddress remoteIPaddress = InetAddress.getByName("localhost");
if (args.length > 0)
remoteIPaddress = InetAddress.getByName(args[0]);
System.out.println("\nClient: file transfer program using unrestricted simplex data link protcol");
System.out.println("Local IP address " + InetAddress.getLocalHost().toString() +
" Remote IP address " + remoteIPaddress.toString() );
FromHost fromHost = new FromHost();
int remotePort = 10000;
int receivePort = 10001;
PhysicalLayer phLayer = new PhysicalLayer(remoteIPaddress, remotePort, receivePort);
PhysicalFrame Sframe = new PhysicalFrame();
PhysicalFrame Rframe = new PhysicalFrame();
int event;
System.out.println("sending file - S indicates a frame transmitted");
while (fromHost.get(Sframe.info))
{
Sframe.kind = PhysicalFrame.FRAME_DATA;
phLayer.sendFrame(Sframe);
System.out.println('S');
}
phLayer.terminate();
System.out.println("Client terminating");
System.exit(0);
}
}
import java.io.*;