Search found 18 matches

by sago
Thu Dec 04, 2008 4:31 pm
Forum: C++ Development
Topic: Send/Receive wxImage by using wxSocketBase
Replies: 6
Views: 844

Thank you very much for these answers, I think that I have a good track.
by sago
Thu Dec 04, 2008 3:38 pm
Forum: C++ Development
Topic: Send/Receive wxImage by using wxSocketBase
Replies: 6
Views: 844

In fact, I get the image from an IP camera: wxString httpAddress= "http://..."; wxURL imageURL(httpAddress); wxInputStream *inputStream = imageURL.GetInputStream(); wxImage downloadedImage; if ((inputStream != NULL) && (downloadedImage.LoadFile(*inputStream, wxBITMAP_TYPE_JPEG))) { downloadedImage.S...
by sago
Thu Dec 04, 2008 1:54 pm
Forum: C++ Development
Topic: Send/Receive wxImage by using wxSocketBase
Replies: 6
Views: 844

Thanks for your answer. This code: unsigned char *memp; mySock->Read(memp,size); means that I must send an unsigned char pointer like: unsigned char *memp; ... mySock->Write(memp,size); So if I have a wxImage, how can I transform it into unsigned char* ; Or if I have a wxInputStream* , how can I tra...
by sago
Thu Dec 04, 2008 11:28 am
Forum: C++ Development
Topic: Send/Receive wxImage by using wxSocketBase
Replies: 6
Views: 844

Send/Receive wxImage by using wxSocketBase

Hi,

Is it possible to send and receive wxImage by using wxSocketBase::Write and wxSocketBase::Read functions?

Thx.
by sago
Thu Nov 20, 2008 1:07 pm
Forum: C++ Development
Topic: How to surcharge wxApp::OnRun() ?
Replies: 1
Views: 369

How to surcharge wxApp::OnRun() ?

Hello! I have an application derived from wxApp. I use the OnInit() function in order to create sockets. I want to add a loop in the main function(OnRun). But if I surcharge this function, the socket events are not "handled". So how can I do it? To give a mark, I 've created a class derived from wxE...
by sago
Tue Nov 11, 2008 4:34 pm
Forum: C++ Development
Topic: wxWidgets' sample ipc
Replies: 3
Views: 730

In fact I have a problem "wxYield called recursively" with an application like the sample ipc. I've seen in the book that it is "normal" and I've seen in the forums that I must launch the socket in a second thread. So I've read the tutorial "Sockets FAQ/Tutorial" and after that I've posted this topi...
by sago
Mon Nov 10, 2008 1:23 pm
Forum: C++ Development
Topic: wxWidgets' sample ipc
Replies: 3
Views: 730

wxWidgets' sample ipc

Hello! I want to do an application client/server like the sample of the library wxWidgets on the repertory "ipc". But I want launch the socket in a second thread that is to say one thread per client. Could you help me please for the beginning ; I have the impression that it is necessary to modify th...
by sago
Fri Nov 07, 2008 11:55 am
Forum: C++ Development
Topic: wxTCP... and recursive Yield
Replies: 7
Views: 1689

Look at http://wiki.wxwidgets.org/docbrowse.cgi/wxwin_wxapp.html#wxappyield "Calling Yield() recursively is normally an error and an assert failure is raised in debug build if such situation is detected. However if the onlyIfNeeded parameter is true, the method will just silently return false inste...
by sago
Tue Nov 04, 2008 2:12 pm
Forum: C++ Development
Topic: wxSocket: wxYield called recursively
Replies: 5
Views: 1819

FireMail wrote:can you show me some code (Thread creation, thread code itself, flags of the socket)
Could you give me an example please, because what I made does not work.

The thread must be joinable or detached ?
by sago
Tue Nov 04, 2008 10:02 am
Forum: C++ Development
Topic: wxSocket: wxYield called recursively
Replies: 5
Views: 1819

I had to create the thread just after we have the event "wxSOCKET_CONNECTION" ? wxTCPServerThread is my thread class: #define TCPSERVERTHREAD #ifdef TCPSERVERTHREAD // -------------------------------------------------------------------------- // wxTCPEventHandler stuff (private class) // -----------...
by sago
Tue Nov 04, 2008 8:47 am
Forum: C++ Development
Topic: wxSocket: wxYield called recursively
Replies: 5
Views: 1819

Sorry I have deleted all the code concerning the threads.. But I use the classes wxTCPServer, wxTCPClient, and wxTCPConnection, so the flag of the sockets is wxSOCKET_WAITALL. I have decided to modifiy theses classes and not my code. Because yestarday I've observed a private class named "wxTCPEventH...
by sago
Mon Nov 03, 2008 9:45 am
Forum: C++ Development
Topic: IPC and wxYield -
Replies: 2
Views: 610

Hello!

I have the same problem as you. Could you help me please ?.
Thx.
by sago
Mon Nov 03, 2008 9:39 am
Forum: C++ Development
Topic: Question about using wxSocketBase::Peek()
Replies: 5
Views: 1372

wxYield called recursively

hi there, there was a good entry in the wxBook. wxSockets do have flags that define how they act (blocking GUI while they receive data, receive all data at once and so on). My problem was that i only used a single thread including GUI and sockets. You need now to imagine that without "blocking GUI"...
by sago
Fri Oct 31, 2008 11:29 am
Forum: C++ Development
Topic: wxSocket: wxYield called recursively
Replies: 5
Views: 1819

I've tried to resolve by using a mutex (in static) in order to protect the calling of the macro PROCESS_EVENTS in the class wxSocketBase used by wxTCPConnection, which calls the function wxYield(), but no result. I have the same error.
by sago
Thu Oct 30, 2008 9:53 am
Forum: C++ Development
Topic: wxSocket: wxYield called recursively
Replies: 5
Views: 1819

wxSocket: wxYield called recursively

Hi! I have a problem with the use of wxTCPServer and wxTCPConnection classes. At execution of the program, if 2 clients start each an event (for example the event OnDisonnect) at the same time, I have this error on server side: assert "wxAsserFailure" failed: wxYield called recursively In accordance...