Home » Source Code » UDP transfer files » udpone.cpp

udpone.cpp ( File view )

  • By clzhou19820922 2013-10-10
  • View(s):20
  • Download(s):1
  • Point(s): 1
			#include "udpone.h"
#include <QtGui/QMessageBox>
udpone::udpone(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{

	ui.setupUi(this);
	m_udp1 = new QUdpSocket(this);
	m_udp2 = new QUdpSocket(this);
	m_add1 = new QHostAddress("127.0.0.1");
	m_add2 = new QHostAddress("127.0.0.1");
	bool bConn = m_udp1->bind(*m_add1, 5555, QUdpSocket::ShareAddress);
	if(!bConn)
	{

		QMessageBox box;
		box.setText("connect error");
		box.exec();
	
}
	else
	{

		connect(m_udp1, SIGNAL(readyRead()), this, SLOT(receive()));
	
}

}

udpone::~udpone()
{



}


void udpone::on_ptn_send_clicked()
{

	QMessageBox box;
	QString qsText = ui.te_send->toPlainText();
	if(0 == qsText.length())
	{

		box.setText("please input what you want to send
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
main.cpp167.00 B24-08-12|10:26
udpone.cpp1.12 kB24-08-12|11:06
udpone.h475.00 B24-08-12|10:38
udpone.qrc66.00 B24-08-12|10:26
udpone.ui1.62 kB24-08-12|10:27
udpone.vcproj8.70 kB24-08-12|10:28
udpone.vcproj.hp-HP.hp.user1.38 kB24-08-12|14:37
udpone.ncb35.00 kB24-08-12|14:37
udpone.sln959.00 B24-08-12|10:26
udpone.suo12.00 kB24-08-12|14:37
Resources0.00 B24-08-12|10:26
udpone0.00 B18-10-12|09:35
...
Sponsored links

udpone.cpp (11.70 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D