small changes here and there
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -24,7 +24,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "wx/socket.h"
|
#include "wx/socket.h"
|
||||||
#include "wx/thread.h"
|
|
||||||
|
|
||||||
#if defined(__WXMOTIF__) || defined(__WXGTK__)
|
#if defined(__WXMOTIF__) || defined(__WXGTK__)
|
||||||
#include "mondrian.xpm"
|
#include "mondrian.xpm"
|
||||||
@@ -89,7 +88,7 @@ bool MyApp::OnInit(void)
|
|||||||
|
|
||||||
// Show the frame
|
// Show the frame
|
||||||
frame->Show(TRUE);
|
frame->Show(TRUE);
|
||||||
|
|
||||||
// Return the main frame window
|
// Return the main frame window
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -98,14 +97,6 @@ extern wxList wxPendingDelete;
|
|||||||
|
|
||||||
void MyFrame::OnSockRequest(wxSocketEvent& evt)
|
void MyFrame::OnSockRequest(wxSocketEvent& evt)
|
||||||
{
|
{
|
||||||
/* this routine gets called from within the
|
|
||||||
waiting socket thread, i.e. here we are
|
|
||||||
not in the main GUI thread and thus we
|
|
||||||
must not call any GUI function here. */
|
|
||||||
/* Wrong ! This routine is called by the main GUI thread
|
|
||||||
because the main GUI thread received a signal from the other
|
|
||||||
thread using wxEvent::ProcessThreadEvent */
|
|
||||||
|
|
||||||
wxSocketBase *sock = evt.Socket();
|
wxSocketBase *sock = evt.Socket();
|
||||||
|
|
||||||
wxPrintf(_T("OnSockRequest OK\n"));
|
wxPrintf(_T("OnSockRequest OK\n"));
|
||||||
@@ -133,21 +124,13 @@ void MyFrame::OnSockRequest(wxSocketEvent& evt)
|
|||||||
|
|
||||||
void MyFrame::OnSockRequestServer(wxSocketEvent& evt)
|
void MyFrame::OnSockRequestServer(wxSocketEvent& evt)
|
||||||
{
|
{
|
||||||
/* this routine gets called from within the
|
|
||||||
waiting socket thread, i.e. here we are
|
|
||||||
not in the main GUI thread and thus we
|
|
||||||
must not call any GUI function here. */
|
|
||||||
/* Wrong ! This routine is called by the main GUI thread
|
|
||||||
because the main GUI thread received a signal from the other
|
|
||||||
thread using wxEvent::ProcessThreadEvent */
|
|
||||||
|
|
||||||
wxSocketBase *sock2;
|
wxSocketBase *sock2;
|
||||||
wxSocketServer *server = (wxSocketServer *) evt.Socket();
|
wxSocketServer *server = (wxSocketServer *) evt.Socket();
|
||||||
|
|
||||||
wxPrintf(_T("OnSockRequestServer OK\n"));
|
wxPrintf(_T("OnSockRequestServer OK\n"));
|
||||||
wxPrintf(_T("OnSockRequest (Main = %d) (event = %d)\n"),wxThread::IsMain(), evt.SocketEvent());
|
wxPrintf(_T("OnSockRequest (event = %d)\n"), evt.SocketEvent());
|
||||||
|
|
||||||
sock2 = server->Accept();
|
sock2 = server->Accept(FALSE);
|
||||||
if (sock2 == NULL)
|
if (sock2 == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -174,7 +157,6 @@ MyFrame::MyFrame(wxFrame *frame):
|
|||||||
sock->SetFlags(wxSocketBase::SPEED);
|
sock->SetFlags(wxSocketBase::SPEED);
|
||||||
sock->Notify(TRUE);
|
sock->Notify(TRUE);
|
||||||
nb_clients = 0;
|
nb_clients = 0;
|
||||||
|
|
||||||
CreateStatusBar(1);
|
CreateStatusBar(1);
|
||||||
UpdateStatus(0);
|
UpdateStatus(0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user