Re: [tcljava-user] Unable to link Tcl variable, badly need help!
Brought to you by:
mdejong
|
From: Georgios P. <pet...@ya...> - 2008-11-09 23:28:32
|
This looks more like a question for comp.lang.tcl, than the tcljava-user
list.
George
O/H Eduard Polyakov ??????:
>
> Hello,
>
>
>
> I have created a new Tcl command, which starts Tftp server from loaded
> DLL, and I am trying to link variables between C and Tcl,
>
> which supposed to count received blocks.
>
> I start the command in a separate Tcl thread in order to receive the
> prompt back. Everything works but Tcl variable never changes its value.
>
>
>
>
>
> //Dll Staff
>
>
>
> extern int RcvBlocks;
>
>
>
> EXTERN_C int DECLSPEC_EXPORT Tftpsrvdll_Init ( Tcl_Interp* interp )
>
> {
>
>
>
> #ifdef USE_TCL_STUBS
>
> Tcl_InitStubs(interp, "8.4", 0);
>
> #endif
>
>
>
> //link variables
>
> Tcl_LinkVar(interp, "env(rcvBlocks)", (char *)&RcvBlocks,
> TCL_LINK_INT);
>
>
>
> //tftps
>
> Tcl_CreateCommand( interp,
>
> "tftps",
>
> (Tcl_CmdProc*) TftpSrv,
>
> (ClientData)NULL,
>
> (Tcl_CmdDeleteProc *)NULL);
>
> return 0;
>
> }
>
>
>
>
>
> //Tcl Staff
>
>
>
> % set env(rcvBlocks) 0
>
> 0
>
> % package require Thread
>
> 2.6.3
>
> % thread::create {
>
> load TftpSrvDLL.dll
>
> tftps -v
>
> }
>
> tid00000E70
>
> TFTP Server MultiThreaded Version 1.53 Windows Built 1530
>
> accepting requests..
>
> % #enter key
>
> % puts env(rcvBlocks)
>
> 0
>
> %
>
> % puts env(rcvBlocks)
>
> 0
>
> %
>
> % Client 192.168.10.152:2269 C:\Tcl\bin\DownloadFile.bin, 4201 Blocks
> Served
>
> % #enter key
>
> % puts env(rcvBlocks)
>
> 0
>
> %
>
>
>
> In addinion I can not get prompt immediately, but have to hit enter
> each time.
>
>
>
> Am I missing something?
>
>
>
> Thanks in advance,
>
> Ed
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> tcljava-user mailing list
> tcl...@li...
> https://lists.sourceforge.net/lists/listinfo/tcljava-user
>
|