Added GSocket for Unix (only GTK for the moment)
Updated wxSocket to use GSocket API Added a progress bar to client.cpp Added CopyTo to wxMemoryOutputStream to copy the internal buffer to a specified buffer. Various changes/fixes to the high-level protocols FTP/HTTP Various Unicode fixes Removed sckint.* git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -111,7 +111,7 @@ void MyFrame::OnSockRequest(wxSocketEvent& evt)
|
||||
printf("OnSockRequest OK\n");
|
||||
printf("OnSockRequest (event = %d)\n",evt.SocketEvent());
|
||||
switch (evt.SocketEvent()) {
|
||||
case wxSocketBase::EVT_READ:
|
||||
case GSOCK_INPUT:
|
||||
unsigned char c;
|
||||
|
||||
sock->Read((char *)&c, 1);
|
||||
@@ -119,7 +119,7 @@ void MyFrame::OnSockRequest(wxSocketEvent& evt)
|
||||
ExecTest1(sock);
|
||||
|
||||
break;
|
||||
case wxSocketBase::EVT_LOST:
|
||||
case GSOCK_LOST:
|
||||
printf("Destroying socket\n");
|
||||
wxPendingDelete.Append(sock);
|
||||
UpdateStatus(-1);
|
||||
@@ -127,7 +127,6 @@ void MyFrame::OnSockRequest(wxSocketEvent& evt)
|
||||
break;
|
||||
}
|
||||
printf("OnSockRequest Exiting\n");
|
||||
sock->SetNotify(wxSocketBase::REQ_READ | wxSocketBase::REQ_LOST);
|
||||
}
|
||||
|
||||
void MyFrame::OnSockRequestServer(wxSocketEvent& evt)
|
||||
@@ -151,10 +150,10 @@ void MyFrame::OnSockRequestServer(wxSocketEvent& evt)
|
||||
return;
|
||||
|
||||
UpdateStatus(1);
|
||||
sock2->SetFlags(wxSocketBase::SPEED);
|
||||
sock2->SetFlags(wxSocketBase::NONE);
|
||||
sock2->Notify(TRUE);
|
||||
sock2->SetEventHandler(*this, SKDEMO_SOCKET);
|
||||
server->SetNotify(wxSocketBase::REQ_ACCEPT);
|
||||
sock2->SetNotify(GSOCK_INPUT_FLAG | GSOCK_LOST_FLAG);
|
||||
}
|
||||
|
||||
// My frame Constructor
|
||||
@@ -166,11 +165,9 @@ MyFrame::MyFrame(wxFrame *frame):
|
||||
addr.Service(3000);
|
||||
|
||||
// Init all
|
||||
wxSocketHandler::Master();
|
||||
|
||||
sock = new wxSocketServer(addr);
|
||||
wxSocketHandler::Master().Register(sock);
|
||||
sock->SetNotify(wxSocketBase::REQ_ACCEPT);
|
||||
sock->SetNotify(GSOCK_CONNECTION_FLAG);
|
||||
sock->SetEventHandler(*this, SKDEMO_SOCKET_SERV);
|
||||
sock->SetFlags(wxSocketBase::SPEED);
|
||||
sock->Notify(TRUE);
|
||||
|
Reference in New Issue
Block a user